Skip to content

Fix logs excluded multiple times if referenced multiple times in the config - #1695

Merged
karensantana merged 4 commits into
mainfrom
fix-logs-excluded-twice
Jun 19, 2026
Merged

Fix logs excluded multiple times if referenced multiple times in the config#1695
karensantana merged 4 commits into
mainfrom
fix-logs-excluded-twice

Conversation

@karensantana

@karensantana karensantana commented May 25, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

When the same log is referenced in the NGINX config multiple times and included in the exclude logs option in the agent config the log is excluded multiple times. Agent has been modified to prevent excluding an access_log or error-log multiple times if it is referenced multiple times in the NGINX config file.

Unit tests covering each scenario have been added.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@karensantana
karensantana requested a review from a team as a code owner May 25, 2026 15:39
@github-actions github-actions Bot added bug Something isn't working chore Pull requests for routine tasks dependencies labels May 25, 2026
@codecov

codecov Bot commented May 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.88%. Comparing base (a52371a) to head (c194451).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1695      +/-   ##
==========================================
+ Coverage   84.86%   84.88%   +0.01%     
==========================================
  Files         105      105              
  Lines       13621    13632      +11     
==========================================
+ Hits        11559    11571      +12     
+ Misses       1539     1538       -1     
  Partials      523      523              
Files with missing lines Coverage Δ
internal/datasource/config/nginx_config_parser.go 79.79% <100.00%> (+0.54%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a52371a...c194451. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@karensantana
karensantana merged commit e91017e into main Jun 19, 2026
88 of 98 checks passed
@karensantana
karensantana deleted the fix-logs-excluded-twice branch June 19, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working chore Pull requests for routine tasks dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants