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

feat: add exclude-list for logs in /var/log #216

Merged
merged 5 commits into from
Dec 6, 2024
Merged

Conversation

lucabello
Copy link
Contributor

@lucabello lucabello commented Dec 5, 2024

Issue

Closes #48.

Solution

Grafana Agent scrapes all the log files under /var/log via a scrape job that defines __path__: /var/log/**/*.log. The scrape job definition allows defining a __path_exclude__ key at the same level, allowing a Glob pattern matching to exclude files from the scrape.

This PR allows users to set that __path_exclude__ key with a config option.

Testing instructions

  1. Deploy Grafana Agent (with `juju config agent exclude_files="some/glob") + Zookeeper on machine, Loki + Traefik + Grafana (to use as Loki UI) on k8s.
  2. Create a file under the excluded path.
  3. Verify the log doesn't appear in Loki.

@lucabello lucabello requested a review from a team as a code owner December 5, 2024 13:43
charmcraft.yaml Outdated Show resolved Hide resolved
@lucabello lucabello merged commit c0382b7 into main Dec 6, 2024
13 checks passed
@lucabello lucabello deleted the feat/var-log-exclude branch December 6, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow more fine-grained selection of /var/log contents
2 participants