newrelic / newrelic-java-agent

The New Relic Java agent
Apache License 2.0
192 stars 140 forks source link

Add "caused by" section(s) when forwarding logs #1857

Closed jtduffy closed 4 weeks ago

jtduffy commented 4 weeks ago

Resolves #1189

This change will add the caused by portion of a stack trace, if available, when decorating logs for forwarding. Note that the maximum stack trace size of 300 is still enforced so stack traces can still be truncated. Added unit tests to verify the new functionality.

This logic is same used when generating stack traces for TracedErrors/ErrorEvents.

Changed instrumentation:

codecov-commenter commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.77%. Comparing base (0e3a23f) to head (ddfb068). Report is 23 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1857 +/- ## ============================================ - Coverage 70.88% 70.77% -0.11% + Complexity 9974 9852 -122 ============================================ Files 829 821 -8 Lines 39985 39694 -291 Branches 6058 6049 -9 ============================================ - Hits 28344 28095 -249 + Misses 8915 8874 -41 + Partials 2726 2725 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.