Skip to content

Commit

Permalink
Enable indy for dubbo instrumentation (#9851)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit committed Nov 13, 2023
1 parent f44149d commit b81082d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 0 additions & 4 deletions instrumentation/apache-dubbo-2.7/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ dependencies {
implementation(project(":instrumentation:apache-dubbo-2.7:library-autoconfigure"))

library("org.apache.dubbo:dubbo:2.7.0")

testImplementation(project(":instrumentation:apache-dubbo-2.7:testing"))

testLibrary("org.apache.dubbo:dubbo-config-api:2.7.0")
}

val latestDepTest = findProperty("testLatestDeps") as Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.internal.injection.ClassInjector;
import io.opentelemetry.javaagent.extension.instrumentation.internal.injection.InjectionMode;
import java.util.List;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;

@AutoService(InstrumentationModule.class)
public class DubboInstrumentationModule extends InstrumentationModule {
public class DubboInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {
public DubboInstrumentationModule() {
super("apache-dubbo", "apache-dubbo-2.7");
}
Expand All @@ -37,8 +41,11 @@ public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
}

@Override
public boolean isIndyModule() {
return false;
public void injectClasses(ClassInjector injector) {
injector
.proxyBuilder(
"io.opentelemetry.javaagent.instrumentation.apachedubbo.v2_7.OpenTelemetryFilter")
.inject(InjectionMode.CLASS_ONLY);
}

@Override
Expand Down

0 comments on commit b81082d

Please sign in to comment.