Skip to content

Commit 59d8140

Browse files
committed
refactor: update JFinal instrumentation configuration
- Simplified classLoader matcher to only exclude JFinal 3.6+ (TypeConverter class) - Updated instrumenter name from jfinal-3.6 to jfinal-3.2 - Adjusted Java version constraint for tests to only apply when not testing latest deps - Updated comment to clarify JFinal 3.6 Java 9+ compatibility issue Change-Id: Ia4a73a9d5767e048c0dfe3897acd394cf641c6b6
1 parent 98e6131 commit 59d8140

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

instrumentation/jfinal-3.2/javaagent/build.gradle.kts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ muzzle {
1111
}
1212
}
1313

14-
otelJava {
15-
// jfinal doesn't work with Java 9+
14+
15+
16+
if (!(findProperty("testLatestDeps") as Boolean)) {
17+
otelJava {
18+
//jfinal 3.6 doesn't work with Java 9+
1619
maxJavaVersionForTests.set(JavaVersion.VERSION_1_8)
20+
}
1721
}
1822

1923
dependencies {

instrumentation/jfinal-3.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jfinal/v3_2/JFinalInstrumentationModule.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@
1818
@AutoService(InstrumentationModule.class)
1919
public class JFinalInstrumentationModule extends InstrumentationModule {
2020
public JFinalInstrumentationModule() {
21-
super("jfinal", "jfinal-3.6");
21+
super("jfinal", "jfinal-3.2");
2222
}
2323

2424
@Override
2525
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
26-
return hasClassesNamed("com.jfinal.core.ActionMapping")
27-
.and(not(hasClassesNamed("com.jfinal.core.TypeConverter")));
26+
return not(hasClassesNamed("com.jfinal.core.TypeConverter"));
2827
}
2928

3029
@Override

instrumentation/jfinal-3.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jfinal/v3_2/JFinalSingletons.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public final class JFinalSingletons {
2626
private static final String SPAN_NAME = "jfinal.handle";
2727
private static final Instrumenter<Void, Void> INSTRUMENTER =
2828
Instrumenter.<Void, Void>builder(
29-
GlobalOpenTelemetry.get(), "io.opentelemetry.jfinal-3.6", s -> SPAN_NAME)
29+
GlobalOpenTelemetry.get(), "io.opentelemetry.jfinal-3.2", s -> SPAN_NAME)
3030
.setEnabled(ExperimentalConfig.get().controllerTelemetryEnabled())
3131
.buildInstrumenter();
3232

0 commit comments

Comments
 (0)