feat: Enable configuration of ignored and expected HTTP status code errors with environment variables #2487
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves #2181 by introducing two new environment variables for configuring agent behavior:
NEW_RELIC_ERROR_COLLECTOR_IGNORE_ERROR_CODES
NEW_RELIC_ERROR_COLLECTOR_EXPECTED_ERROR_CODES
Both env vars support defining multiple HTTP status codes in a comma-separated list, e.g.:
NEW_RELIC_ERROR_COLLECTOR_IGNORE_ERROR_CODES="401,503"
The env var for expected error codes also supports defining a range of codes like this:
NEW_RELIC_ERROR_COLLECTOR_EXPECTED_ERROR_CODES="401,500-505"
The internal logic of the error collector doesn't currently support ranges for ignored error codes, hence the difference.
I will update the description of this PR with a link to the docs site update PR once that is created.
Author Checklist
Integration tests, and Unbounded testscompletedPerformance testing completed with satisfactory results (if required)N/AReviewer Checklist