-
Notifications
You must be signed in to change notification settings - Fork 143
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
expected_status_codes is not honored when there is an exception in the transaction #376
Comments
This is likely due to the difference between ThrowableError and HttpTracedError. |
The repository below has a simple app to reproduce the problem. |
Any idea when this might get looked at? This causes many false alarms in our monitoring due to things like input validation errors (HTTP bad request). |
If an exception is thrown that has an associated HTTP error response code then simply configuring the error response code as expected ( This works for the repro app that was previously posted:
If the controller is modified in the repro app so that it only returns an error response code instead of throwing an exception:
then the
|
Some additional details from a deep dive: https://newrelic.atlassian.net/browse/GTSE-10856?focusedCommentId=980682 |
I think the problem starts here with newrelic-java-agent/newrelic-agent/src/main/java/com/newrelic/agent/errors/ErrorServiceImpl.java Line 441 in bf6cb39
We only check whether it's expected on the Throwable. As @meiao hinted on newrelic-java-agent/newrelic-agent/src/main/java/com/newrelic/agent/errors/ErrorServiceImpl.java Line 467 in bf6cb39
|
Correction...we also need to check this for ThrowableError. |
newrelic-java-agent/newrelic-agent/src/main/java/com/newrelic/agent/errors/ErrorServiceImpl.java Line 459 in 53dc9bb
|
Do we need to update our New Relic Agent to apply the fix? |
Yes. Agent 7.5.0 has the fix. |
Description
Setting a
expected_status_code
will not mark an error as expected when there is an exception in the transaction.Expected Behavior
If a transaction returns with a status code that is in the
expected_status_code
an error from this transaction should be marked as expected regardless of the existence of an exception.This is how
ignored_status_code
works.The text was updated successfully, but these errors were encountered: