newrelic / newrelic-java-agent

The New Relic Java agent
Apache License 2.0
196 stars 141 forks source link

Spring Boot app traces show 100% of time as Remainder #352

Open rtzm opened 2 years ago

rtzm commented 2 years ago

Description

When looking at transaction traces for an endpoint on our Spring Boot app, it seems that often the trace details show that 100% of the time was spent in "Remainder". (Screenshot of issue attached.) This is happening more frequently, and possibly correlates with when downstream dependencies throw errors.

We've added @Trace annotations to the method where the error/exception is being thrown, but in these transactions it doesn't appear in the trace.

Expected Behavior

I expected to see a trace of the methods called (especially the method annotated with @Trace), even if the code resulted in an exception.

Troubleshooting or NR Diag results

Here is what shows up in our trace:

image

Steps to Reproduce

This is a Spring Boot app instrumented with New Relic that receives a Web call to the app. There are sometimes errors that New Relic UI has correlated with these "Remainder" traces, suggesting that the issue is that an external dependency has returned an exception (such as a 503). These exceptions are also nested, which NR support suggested might also present a problem.

Our app followed some patterns for ControllerAdvice in this model: https://github.com/mechero/spring-boot-rest-exceptions

Your Environment

Spring Boot version 2.3.0.RELEASE. Using versions 7.1.1 of New Relic agent and 7.1.0 of the agent API. JVM is OpenJDK 64-Bit Server VM, version 11.0.8+10.

Additional context

Support ticket: https://support.newrelic.com/tickets/464028/edit (was directed to add issue here after support reported this as expected behavior)

(Migrate to Jira)

workato-integration[bot] commented 1 year ago

https://issues.newrelic.com/browse/NEWRELIC-4056