newrelic / newrelic-java-agent

The New Relic Java agent
Apache License 2.0
202 stars 143 forks source link

JSP v3 Tag library instrumentation for RUM script injection #1943

Closed jtduffy closed 4 months ago

jtduffy commented 4 months ago

Resolves #1695

Injection of the Real User Monitoring Script Via JSP Tag Libraries

Prior to the additions to this instrumentation module, the only way to inject the RUM script into JSPs was during the compilation phase of the Jasper compiler, which injects the script into the HTML <head> element, if present in the page source.

Some applications use custom JSP tag libraries to create the head tag (and other HTML page elements). In this scenario, the RUM script will not be injected because of the way the Jasper compiler instrumentation detects the head tag. This instrumentation module weaves the SimpleTagSupport and TagSupport classes to detect the creation of head elements via the tag execution and inject the RUM script at that time.

See the included README for more information.

codecov-commenter commented 4 months ago

Codecov Report

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

Project coverage is 69.81%. Comparing base (1082ec6) to head (a4ca754). Report is 414 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1943 +/- ## ============================================ - Coverage 70.66% 69.81% -0.85% + Complexity 9858 9757 -101 ============================================ Files 826 826 Lines 39804 39792 -12 Branches 6062 6061 -1 ============================================ - Hits 28127 27781 -346 - Misses 8951 9329 +378 + Partials 2726 2682 -44 ```

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