File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
struts-7.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/struts/v7_0 Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ dependencies {
2727 testInstrumentation(project(" :instrumentation:jetty:jetty-8.0:javaagent" ))
2828 testInstrumentation(project(" :instrumentation:struts:struts-7.0:javaagent" ))
2929
30- latestDepTestLibrary(" org.apache.struts:struts2-core:6.0. +" )
30+ latestDepTestLibrary(" org.apache.struts:struts2-core:6.+" )
3131}
3232
3333tasks.withType<Test >().configureEach {
Original file line number Diff line number Diff line change 55
66package io .opentelemetry .javaagent .instrumentation .struts .v7_0 ;
77
8+ import static io .opentelemetry .javaagent .extension .matcher .AgentElementMatchers .hasClassesNamed ;
89import static java .util .Collections .singletonList ;
910
1011import com .google .auto .service .AutoService ;
1112import io .opentelemetry .javaagent .extension .instrumentation .InstrumentationModule ;
1213import io .opentelemetry .javaagent .extension .instrumentation .TypeInstrumentation ;
1314import java .util .List ;
15+ import net .bytebuddy .matcher .ElementMatcher ;
1416
1517@ AutoService (InstrumentationModule .class )
1618public class Struts2InstrumentationModule extends InstrumentationModule {
@@ -19,6 +21,12 @@ public Struts2InstrumentationModule() {
1921 super ("struts" , "struts-7.0" );
2022 }
2123
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+
2230 @ Override
2331 public List <TypeInstrumentation > typeInstrumentations () {
2432 return singletonList (new ActionInvocationInstrumentation ());
You can’t perform that action at this time.
0 commit comments