newrelic / newrelic/newrelic-java-agent
Replace JasperCompilerPointCut with weaver instrumentation module
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 240
- Forks
- 170
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 21
Description
Description
Point cut: com.newrelic.agent.instrumentation.pointcuts.container.JasperCompilerPointCut
Instruments the following classes/methods:
org.apache.jasper.compiler.Compiler.compile(boolean, boolean) (JSP 2.0)
org.apache.jasper.compiler.Compiler.compile(boolean) (JSP 2.0, JSP 2.1)
Uses some reflection magic to extract the JSP file path and create a metric name in the form View/my_page.jsp/Compile
This point cut also creates a JasperCompilerTracer which setups RUM browser script injection. This will probably require a change to AgentBridge to expose a noticeJspCompile method that is currently called by the point cut.
The best approach is to probably create a brand new module, which will provide support for Tomcat v7+.
The target artifact is org.apache.tomcat.tomcat-jasper. For this approach, the compile(boolean, boolean) is the only method that needs to be instrumented.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with newrelic-agent/src/main/java/com/newrelic/agent/instrumentation/pointcuts/container/JasperCompilerPointCut.java and trace its JasperCompilerTracer and AgentBridge noticeJspCompile usage. Replace this point cut with a module targeting org.apache.tomcat.tomcat-jasper and instrumenting Compiler.compile(boolean, boolean), preserving JSP metrics and RUM script injection for Tomcat 7+.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, devtools
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100