State can be GCd before exit advice is run
MODIFY
dd-java-agent/instrumentation/couchbase-2.0/src/test/groovy/springdata/CouchbaseSpringRepositoryTest.groovy
dd-java-agent/instrumentation/couchbase-2.0/src/test/groovy/springdata/CouchbaseSpringRepositoryTest.groovy
@@ -83,9 +83,6 @@ class CouchbaseSpringRepositoryTest extends AbstractCouchbaseTest {
assertCouchbaseCall(it, 0, "Bucket.query", bucketCouchbase.name())
}
}
-
- where:
- indexName = "test-index"
}
def "test CRUD"() {

MODIFY
dd-java-agent/instrumentation/couchbase-2.6/src/main/java/datadog/trace/instrumentation/couchbase/client/CouchbaseCoreInstrumentation.java
dd-java-agent/instrumentation/couchbase-2.6/src/main/java/datadog/trace/instrumentation/couchbase/client/CouchbaseCoreInstrumentation.java
@@ -77,10 +77,12 @@ public class CouchbaseCoreInstrumentation extends Instrumenter.Default {
state = new CouchbaseRequestState(span);
contextStore.put(request, state);
+ if (request.operationId() != null) {
span.setTag("couchbase.operation_id", request.operationId());
}
}
}
+ }
// 2.6.0 and above
public static void muzzleCheck(final JsonCryptoTranscoder transcoder) {

MODIFY
dd-java-agent/instrumentation/couchbase-2.6/src/main/java/datadog/trace/instrumentation/couchbase/client/CouchbaseNetworkInstrumentation.java
dd-java-agent/instrumentation/couchbase-2.6/src/main/java/datadog/trace/instrumentation/couchbase/client/CouchbaseNetworkInstrumentation.java
@@ -61,7 +61,7 @@ public class CouchbaseNetworkInstrumentation extends Instrumenter.Default {
}
public static class CouchbaseNetworkAdvice {
- @Advice.OnMethodExit(suppress = Throwable.class)
+ @Advice.OnMethodEnter(suppress = Throwable.class)
public static void addNetworkTagsToSpan(
@Advice.FieldValue("remoteHostname") final String remoteHostname,
@Advice.FieldValue("remoteSocket") final String remoteSocket,

State can be GCd before exit advice is run