Update couchbase instrumentation shading
for consistency with other instrumentations
MODIFY
instrumentation/couchbase/couchbase-3.1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1_6/CouchbaseEnvironmentInstrumentation.java
instrumentation/couchbase/couchbase-3.1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1_6/CouchbaseEnvironmentInstrumentation.java
@@ -9,10 +9,10 @@ import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
import static net.bytebuddy.matcher.ElementMatchers.named;
import com.couchbase.client.core.env.CoreEnvironment;
-import com.couchbase.v3_1_6.client.tracing.opentelemetry.OpenTelemetryRequestTracer;
import io.opentelemetry.api.GlobalOpenTelemetry;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
+import io.opentelemetry.javaagent.instrumentation.couchbase.v3_1_6.shaded.com.couchbase.client.tracing.opentelemetry.OpenTelemetryRequestTracer;
import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;

MODIFY
instrumentation/couchbase/couchbase-3.1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1_6/CouchbaseInstrumentationModule.java
instrumentation/couchbase/couchbase-3.1.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1_6/CouchbaseInstrumentationModule.java
@@ -20,11 +20,6 @@ public class CouchbaseInstrumentationModule extends InstrumentationModule {
super("couchbase", "couchbase-3.1.6");
}
- @Override
- public boolean isHelperClass(String className) {
- return className.startsWith("com.couchbase.v3_1_6.client.tracing.opentelemetry");
- }
-
@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
// New class introduced in 3.1, the minimum version we support.

MODIFY
instrumentation/couchbase/couchbase-3.1.6/tracing-opentelemetry-shaded/build.gradle.kts
instrumentation/couchbase/couchbase-3.1.6/tracing-opentelemetry-shaded/build.gradle.kts
@@ -16,7 +16,7 @@ tasks {
// including only tracing-opentelemetry excludes its transitive dependencies
include(dependency("com.couchbase.client:tracing-opentelemetry"))
}
- relocate("com.couchbase.client.tracing.opentelemetry", "com.couchbase.v3_1_6.client.tracing.opentelemetry")
+ relocate("com.couchbase.client.tracing.opentelemetry", "io.opentelemetry.javaagent.instrumentation.couchbase.v3_1_6.shaded.com.couchbase.client.tracing.opentelemetry")
}
val extractShadowJar by registering(Copy::class) {

MODIFY
instrumentation/couchbase/couchbase-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1/CouchbaseEnvironmentInstrumentation.java
instrumentation/couchbase/couchbase-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1/CouchbaseEnvironmentInstrumentation.java
@@ -9,10 +9,10 @@ import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
import static net.bytebuddy.matcher.ElementMatchers.named;
import com.couchbase.client.core.env.CoreEnvironment;
-import com.couchbase.v3_1.client.tracing.opentelemetry.OpenTelemetryRequestTracer;
import io.opentelemetry.api.GlobalOpenTelemetry;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
+import io.opentelemetry.javaagent.instrumentation.couchbase.v3_1.shaded.com.couchbase.client.tracing.opentelemetry.OpenTelemetryRequestTracer;
import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;

MODIFY
instrumentation/couchbase/couchbase-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1/CouchbaseInstrumentationModule.java
instrumentation/couchbase/couchbase-3.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1/CouchbaseInstrumentationModule.java
@@ -20,11 +20,6 @@ public class CouchbaseInstrumentationModule extends InstrumentationModule {
super("couchbase", "couchbase-3.1");
}
- @Override
- public boolean isHelperClass(String className) {
- return className.startsWith("com.couchbase.v3_1.client.tracing.opentelemetry");
- }
-
@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
// New class introduced in 3.1, the minimum version we support.

MODIFY
instrumentation/couchbase/couchbase-3.1/tracing-opentelemetry-shaded/build.gradle.kts
instrumentation/couchbase/couchbase-3.1/tracing-opentelemetry-shaded/build.gradle.kts
@@ -16,7 +16,7 @@ tasks {
// including only tracing-opentelemetry excludes its transitive dependencies
include(dependency("com.couchbase.client:tracing-opentelemetry"))
}
- relocate("com.couchbase.client.tracing.opentelemetry", "com.couchbase.v3_1.client.tracing.opentelemetry")
+ relocate("com.couchbase.client.tracing.opentelemetry", "io.opentelemetry.javaagent.instrumentation.couchbase.v3_1.shaded.com.couchbase.client.tracing.opentelemetry")
}
val extractShadowJar by registering(Copy::class) {

MODIFY
instrumentation/couchbase/couchbase-3.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_2/CouchbaseEnvironmentInstrumentation.java
instrumentation/couchbase/couchbase-3.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_2/CouchbaseEnvironmentInstrumentation.java
@@ -9,10 +9,10 @@ import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
import static net.bytebuddy.matcher.ElementMatchers.named;
import com.couchbase.client.core.env.CoreEnvironment;
-import com.couchbase.v3_2.client.tracing.opentelemetry.OpenTelemetryRequestTracer;
import io.opentelemetry.api.GlobalOpenTelemetry;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
+import io.opentelemetry.javaagent.instrumentation.couchbase.v3_2.shaded.com.couchbase.client.tracing.opentelemetry.OpenTelemetryRequestTracer;
import net.bytebuddy.asm.Advice;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;

MODIFY
instrumentation/couchbase/couchbase-3.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_2/CouchbaseInstrumentationModule.java
instrumentation/couchbase/couchbase-3.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_2/CouchbaseInstrumentationModule.java
@@ -20,11 +20,6 @@ public class CouchbaseInstrumentationModule extends InstrumentationModule {
super("couchbase", "couchbase-3.1.6");
}
- @Override
- public boolean isHelperClass(String className) {
- return className.startsWith("com.couchbase.v3_2.client.tracing.opentelemetry");
- }
-
@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
// New class introduced in 3.2.

MODIFY
instrumentation/couchbase/couchbase-3.2/tracing-opentelemetry-shaded/build.gradle.kts
instrumentation/couchbase/couchbase-3.2/tracing-opentelemetry-shaded/build.gradle.kts
@@ -16,7 +16,7 @@ tasks {
// including only tracing-opentelemetry excludes its transitive dependencies
include(dependency("com.couchbase.client:tracing-opentelemetry"))
}
- relocate("com.couchbase.client.tracing.opentelemetry", "com.couchbase.v3_2.client.tracing.opentelemetry")
+ relocate("com.couchbase.client.tracing.opentelemetry", "io.opentelemetry.javaagent.instrumentation.couchbase.v3_2.shaded.com.couchbase.client.tracing.opentelemetry")
}
val extractShadowJar by registering(Copy::class) {

Update couchbase instrumentation shading (#7023)

for consistency with other instrumentations