Skip to content

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

Open
karensantana wants to merge 2 commits into
mainfrom
fix-logs-excluded-twice
Open

Fix logs excluded multiple times if referenced multiple times in the config#1695
karensantana wants to merge 2 commits into
mainfrom
fix-logs-excluded-twice

Conversation

@karensantana
Copy link
Copy Markdown

@karensantana karensantana commented May 25, 2026

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
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.02%. Comparing base (59d9c4d) to head (8b10e1b).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1695      +/-   ##
==========================================
+ Coverage   84.99%   85.02%   +0.03%     
==========================================
  Files         104      104              
  Lines       13579    13590      +11     
==========================================
+ Hits        11541    11555      +14     
+ Misses       1524     1521       -3     
  Partials      514      514              
Files with missing lines Coverage Δ
internal/datasource/config/nginx_config_parser.go 79.79% <100.00%> (+0.54%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

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

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.

1 participant