Skip to content

Ignore Access Log in metrics collection if Formats differ #1097

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

Merged
merged 10 commits into from
May 30, 2025

Conversation

aphralG
Copy link
Contributor

@aphralG aphralG commented May 29, 2025

Proposed changes

When more than one log format is specified for a access log in the nginx config, otel panics trying to monitor the same log with two different formats.

If its the same access log read from the config but the format is different the following will be logged as a Warning:
time=2025-05-29T10:01:49.448Z level=WARN msg="Found duplicate access log with different formats. Multiple log formats are not supported in the same access log, will not be collected" access_log=/var/log/nginx/access.log

If its the same access log read from the config but with the same format the following will be logged in Debug:
time=2025-05-29T10:04:07.231Z level=DEBUG msg="Found duplicate access log, skipping" access_log=/var/log/nginx/access.log

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

@aphralG aphralG self-assigned this May 29, 2025
@aphralG aphralG requested a review from a team as a code owner May 29, 2025 10:21
@github-actions github-actions bot added the chore Pull requests for routine tasks label May 29, 2025
@oCHRISo oCHRISo merged commit 0de3ba3 into v3 May 30, 2025
18 checks passed
@oCHRISo oCHRISo deleted the fix-panic-with-two-log-formats branch May 30, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants