newrelic / newrelic/newrelic-java-agent

Replace JasperCompilerPointCut with weaver instrumentation module

Open
#2,854 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.