-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1685 from newrelic/NR709_AbsurdValues
Swap the ProcessPointCut over to a weaver instrumentation module to …
- Loading branch information
Showing
7 changed files
with
66 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
dependencies { | ||
implementation(project(":agent-bridge")) | ||
} | ||
|
||
// This instrumentation module should not use the bootstrap classpath | ||
|
||
|
||
jar { | ||
manifest { attributes 'Implementation-Title': 'com.newrelic.instrumentation.java.process' } | ||
} | ||
|
||
verifyInstrumentation { | ||
verifyClasspath = false // We don't want to verify classpath since these are JDK classes | ||
} | ||
|
||
site { | ||
title 'Java Process' | ||
type 'Other' | ||
versionOverride '[8,)' | ||
} |
20 changes: 20 additions & 0 deletions
20
instrumentation/java.process/src/main/java/java/lang/Process_Instrumentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package java.lang; | ||
|
||
import com.newrelic.agent.bridge.AgentBridge; | ||
import com.newrelic.agent.bridge.Transaction; | ||
import com.newrelic.api.agent.Trace; | ||
import com.newrelic.api.agent.weaver.MatchType; | ||
import com.newrelic.api.agent.weaver.Weave; | ||
import com.newrelic.api.agent.weaver.Weaver; | ||
|
||
@Weave(type = MatchType.Interface, originalName = "java.lang.Process") | ||
public class Process_Instrumentation { | ||
@Trace | ||
public int waitFor() { | ||
Transaction transaction = AgentBridge.getAgent().getTransaction(false); | ||
if (transaction != null) { | ||
transaction.getTracedMethod().setMetricName("Java", "Process", "waitFor"); | ||
} | ||
return Weaver.callOriginal(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
...lic-agent/src/main/java/com/newrelic/agent/instrumentation/pointcuts/ProcessPointCut.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters