File tree 2 files changed +9
-1
lines changed
struts-7.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/struts/v7_0
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ dependencies {
27
27
testInstrumentation(project(" :instrumentation:jetty:jetty-8.0:javaagent" ))
28
28
testInstrumentation(project(" :instrumentation:struts:struts-7.0:javaagent" ))
29
29
30
- latestDepTestLibrary(" org.apache.struts:struts2-core:6.0. +" )
30
+ latestDepTestLibrary(" org.apache.struts:struts2-core:6.+" )
31
31
}
32
32
33
33
tasks.withType<Test >().configureEach {
Original file line number Diff line number Diff line change 5
5
6
6
package io .opentelemetry .javaagent .instrumentation .struts .v7_0 ;
7
7
8
+ import static io .opentelemetry .javaagent .extension .matcher .AgentElementMatchers .hasClassesNamed ;
8
9
import static java .util .Collections .singletonList ;
9
10
10
11
import com .google .auto .service .AutoService ;
11
12
import io .opentelemetry .javaagent .extension .instrumentation .InstrumentationModule ;
12
13
import io .opentelemetry .javaagent .extension .instrumentation .TypeInstrumentation ;
13
14
import java .util .List ;
15
+ import net .bytebuddy .matcher .ElementMatcher ;
14
16
15
17
@ AutoService (InstrumentationModule .class )
16
18
public class Struts2InstrumentationModule extends InstrumentationModule {
@@ -19,6 +21,12 @@ public Struts2InstrumentationModule() {
19
21
super ("struts" , "struts-7.0" );
20
22
}
21
23
24
+ @ Override
25
+ public ElementMatcher .Junction <ClassLoader > classLoaderMatcher () {
26
+ // class is in different package before 7.0
27
+ return hasClassesNamed ("org.apache.struts2.config.entities.ActionConfig" );
28
+ }
29
+
22
30
@ Override
23
31
public List <TypeInstrumentation > typeInstrumentations () {
24
32
return singletonList (new ActionInvocationInstrumentation ());
You can’t perform that action at this time.
0 commit comments