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

Patroni logs with grafana-agent causing a lot of unrelease file and huge syslog #524

Open
honghan-wong opened this issue Jul 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@honghan-wong
Copy link

Steps to reproduce

  1. install postgresql charm 14/edge, revision 425
  2. integrate with COS
  3. grafana-agent will keep track of all the logs files under /var/snap/charmed-postgresql/common/var/log/patroni, which causing syslog become several GB huge, spamming with logs like below:
Jun 30 00:00:03 landscapesql-new-1 grafana-agent.grafana-agent[416696]: ts=2024-06-30T00:00:03.940798064Z caller=filetargetmanager.go:181 level=info component=logs logs_config=log_file_scraper msg="received file watcher event" name=/snap/grafana-agent/16/shared-logs/patroni/patroni.log.6545 op=CREATE
  1. running lsof -nP | grep '(deleted)' on the postgresql with grafana-agent, we can see if the patroni logs are getting rotated, grafana-agent couldn't handle it correctly and causing a lot of unrelease files.
agent     1740025 1740154 agent                root *510r      REG              252,2         488     568380 /snap/grafana-agent/16/shared-logs/patroni/patroni.log.10080 (deleted)
agent     1740025 1740154 agent                root *511r      REG              252,2         488     561238 /snap/grafana-agent/16/shared-logs/patroni/patroni.log.10080 (deleted)

Expected behavior

  1. A smaller number of logs files, either
    a. set by default in /var/snap/charmed-postgresql/115/etc/patroni/patroni.yaml
    b. have an option in charm to configure the log.file_num
  2. Logs files are cleaned correctly

Actual behavior

You may find the logs in the summary above.

Versions

Operating system:
Ubuntu 22.04.4 LTS

Juju CLI:
3.1.8-genericlinux-amd64

Juju agent:
3.1.8

Charm revision: 425

LXD: 4.0.9

Log output

Juju debug log:

Additional context

@honghan-wong honghan-wong added the bug Something isn't working label Jul 4, 2024
Copy link
Contributor

github-actions bot commented Jul 4, 2024

@taurus-forever
Copy link
Contributor

Invited COS team into the fix implementation/coordination: canonical/grafana-agent-operator#153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants