Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies {

testImplementation(project(":instrumentation:couchbase:couchbase-common:testing"))

// TODO testInstrumentation(project(":instrumentation:couchbase:couchbase-2.6:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-2.6:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.1:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.1.6:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.2:javaagent"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package io.opentelemetry.javaagent.instrumentation.couchbase.v2_0;

import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;

Expand All @@ -13,6 +14,7 @@
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
import java.util.List;
import net.bytebuddy.matcher.ElementMatcher;

@AutoService(InstrumentationModule.class)
public class CouchbaseInstrumentationModule extends InstrumentationModule
Expand Down Expand Up @@ -46,4 +48,10 @@ public List<String> injectedClassNames() {
public boolean isIndyReady() {
return true;
}

@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
// removed in 3.x
return hasClassesNamed("com.couchbase.client.java.CouchbaseAsyncBucket");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@

package io.opentelemetry.javaagent.instrumentation.couchbase.v2_6;

import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed;
import static java.util.Arrays.asList;

import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
import java.util.List;
import net.bytebuddy.matcher.ElementMatcher;

@AutoService(InstrumentationModule.class)
public class CouchbaseInstrumentationModule extends InstrumentationModule
Expand All @@ -21,6 +23,12 @@ public CouchbaseInstrumentationModule() {
super("couchbase", "couchbase-2.6");
}

@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
// introduced in java-client 2.6, removed in 3.x
return hasClassesNamed("com.couchbase.client.java.auth.CertAuthenticator");
}

@Override
public List<TypeInstrumentation> typeInstrumentations() {
return asList(new CouchbaseCoreInstrumentation(), new CouchbaseNetworkInstrumentation());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies {

testInstrumentation(project(":instrumentation:couchbase:couchbase-2.0:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-2.6:javaagent"))
// TODO testInstrumentation(project(":instrumentation:couchbase:couchbase-3.1:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.1:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.2:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.4:javaagent"))
testImplementation("org.testcontainers:testcontainers-couchbase")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ public CouchbaseInstrumentationModule() {

@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
// New class introduced in 3.1, the minimum version we support.
// NB: Couchbase does not provide any API guarantees on their core IO artifact so reconsider
// instrumenting it instead of each individual JVM artifact if this becomes unmaintainable.
return hasClassesNamed("com.couchbase.client.core.cnc.TracingIdentifiers")
// added in 3.2
// introduced in java-client 3.1.6 (core-io 2.1.6)
return hasClassesNamed("com.couchbase.client.core.endpoint.EventingEndpoint")
// introduced in java-client 3.2.0 (core-io 2.2.0)
.and(not(hasClassesNamed("com.couchbase.client.core.cnc.RequestSpan$StatusCode")));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies {

testInstrumentation(project(":instrumentation:couchbase:couchbase-2.0:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-2.6:javaagent"))
// TODO testInstrumentation(project(":instrumentation:couchbase:couchbase-3.1.6:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.1.6:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.2:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.4:javaagent"))
testImplementation("org.testcontainers:testcontainers-couchbase")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ public CouchbaseInstrumentationModule() {

@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
// New class introduced in 3.1, the minimum version we support.
// NB: Couchbase does not provide any API guarantees on their core IO artifact so reconsider
// instrumenting it instead of each individual JVM artifact if this becomes unmaintainable.
// introduced in java-client 3.1.0 (core-io 2.1.0)
return hasClassesNamed("com.couchbase.client.core.cnc.TracingIdentifiers")
// added in 3.2
.and(not(hasClassesNamed("com.couchbase.client.core.cnc.RequestSpan$StatusCode")));
// introduced in java-client 3.1.6 (core-io 2.1.6)
.and(not(hasClassesNamed("com.couchbase.client.core.endpoint.EventingEndpoint")));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies {
testInstrumentation(project(":instrumentation:couchbase:couchbase-2.0:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-2.6:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.1:javaagent"))
// TODO testInstrumentation(project(":instrumentation:couchbase:couchbase-3.1.6:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.1.6:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.4:javaagent"))

latestDepTestLibrary("com.couchbase.client:java-client:3.3.+") // see couchbase-3.4 module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public CouchbaseInstrumentationModule() {

@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
// New class introduced in 3.2.
// CoreTransactionRequest was introduced in 3.4.0.
// introduced in java-client 3.2.0 (core-io 2.2.0)
return hasClassesNamed("com.couchbase.client.core.cnc.RequestSpan$StatusCode")
// introduced in java-client 3.4.0 (core-io 2.4.0)
.and(
not(
hasClassesNamed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies {
testInstrumentation(project(":instrumentation:couchbase:couchbase-2.0:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-2.6:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.1:javaagent"))
// TODO testInstrumentation(project(":instrumentation:couchbase:couchbase-3.1.6:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.1.6:javaagent"))
testInstrumentation(project(":instrumentation:couchbase:couchbase-3.2:javaagent"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public CouchbaseInstrumentationModule() {

@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
// CoreTransactionRequest was introduced in 3.4.0 with integrated transactions support.
// introduced in java-client 3.4.0 (core-io 2.4.0)
return hasClassesNamed(
"com.couchbase.client.core.transaction.components.CoreTransactionRequest");
}
Expand Down
Loading