Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a logrotate conf for subagent logs #254

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

yuryu
Copy link
Member

@yuryu yuryu commented Oct 29, 2021

The rationale is provided in #251. This PR adds a default logrotate conf for Linux packages.

The config is based on the default debian syslog rule, and does:

  • maintain up to four copies (up to a month)
  • rotate weekly
  • don't fail if log files are missing
  • don't rotate if log is empty
  • compress logs two generations older

We don't need to restart fluent-bit because currently fluent-bit opens and closes log files every time it writes something.

@qingling128 qingling128 requested review from a team and hsmatulisgoogle and removed request for a team November 1, 2021 17:25
pkg/rpm/google-cloud-ops-agent.spec Outdated Show resolved Hide resolved
default-logrotate-conf Outdated Show resolved Hide resolved
build.sh Outdated Show resolved Hide resolved
Copy link
Member

@igorpeshansky igorpeshansky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to ask — what about Windows? Wouldn't it suffer from the same issues?

@yuryu
Copy link
Member Author

yuryu commented Nov 1, 2021

I'll address the comments shortly. I haven't used it on Windows and don't know, but it looks like fluent-bit is configured to produce a log file on Windows as well? In that case I'd assume yes. Windows doesn't have logrotate so we would need to work around it (I think many services use the system event log instead of local files).

@yuryu yuryu requested a review from igorpeshansky November 4, 2021 18:06
@jeremyvisser
Copy link

We have a fleet of RHEL and OEL machines affected by this issue, and while @igorpeshansky's suggestion to implement Windows log rotation is made in good faith, it may be the perfect preventing good from happening.

I think that Windows log rotation is a valid thing to ask for, but can we merge the Linux–only log rotation for the time being since the log files in the wild are not getting any smaller?

@inglor
Copy link

inglor commented Feb 14, 2022

I just investigated an issue with one of the VMs running out of space and the culprit was the logging from the agent resulted in 22G file. Please merge this.

@yuryu
Copy link
Member Author

yuryu commented Aug 26, 2022

I don't know why the check is failing. I didn't change anything about Windows but somehow it's Windows that's failing? Let me know if there's anything I can do.

@qingling128 qingling128 added the kokoro:force-run Forces kokoro to run integration tests on a CL label Aug 26, 2022
@stackdriver-instrumentation-release stackdriver-instrumentation-release removed the kokoro:force-run Forces kokoro to run integration tests on a CL label Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants