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: Enable configuration of ignored and expected HTTP status code errors with environment variables #2487

Merged
merged 5 commits into from
May 17, 2024

Conversation

nr-ahemsath
Copy link
Member

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

  • Unit tests, Integration tests, and Unbounded tests completed
  • Performance testing completed with satisfactory results (if required) N/A

Reviewer Checklist

  • Perform code review
  • Pull request was adequately tested (new/existing tests, performance tests)

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.60%. Comparing base (c358d21) to head (68125ad).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2487      +/-   ##
==========================================
+ Coverage   80.57%   80.60%   +0.02%     
==========================================
  Files         459      459              
  Lines       28777    28774       -3     
  Branches     3184     3184              
==========================================
+ Hits        23186    23192       +6     
+ Misses       4805     4798       -7     
+ Partials      786      784       -2     
Flag Coverage Δ
Agent 81.54% <100.00%> (+0.03%) ⬆️
Profiler 72.15% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...c/Agent/Core/Configuration/DefaultConfiguration.cs 89.17% <100.00%> (+0.31%) ⬆️

... and 3 files with indirect coverage changes

@nr-ahemsath nr-ahemsath merged commit eeb574f into main May 17, 2024
97 checks passed
@nr-ahemsath nr-ahemsath deleted the feature/config-expected-ignored-errors-env-vars branch May 17, 2024 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants