-
Notifications
You must be signed in to change notification settings - Fork 312
Add operation id and network tags to Couchbase #996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few requests below...
...-2.6/src/main/java/datadog/trace/instrumentation/couchbase/client/CouchbaseRequestState.java
Outdated
Show resolved
Hide resolved
...ain/java/datadog/trace/instrumentation/couchbase/client/CouchbaseNetworkInstrumentation.java
Outdated
Show resolved
Hide resolved
|
||
// 2.6.0 and above | ||
public static void muzzleCheck(final JsonCryptoTranscoder transcoder) { | ||
transcoder.documentType(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed in both instrumentation classes? I usually prefer adding this only if there is misalignment. What is the limiting factor that makes this integration only work with 2.6 instead of 2.5.x?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The network instrumentation relies on the core instrumentation to add the span to the ContextStore
. If the core instrumentation is turned off because the user is running pre-2.6, the network instrumentation will be a noop every time. Might as well turn off the network instrumentation too.
operationId()
was added to CouchbaseRequest
in 2.6 . Before that, for each message type, there was a different way of extracting the id (including parsing JSON strings). Also, different versions have different message types so it would involve creating an instrumentation for each of couchbase-2.1, couchbase-2.2, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in that case this only needs to be added here since core advice will get muzzled automatically because of the use of operationId()
. (IE, remove the check from the core instrumentation class.
99707a1
to
835450c
Compare
d038f72
to
43cbf7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Go ahead and merge once that method is removed.
} | ||
|
||
// 2.6.0 and above | ||
public static void muzzleCheck(final JsonCryptoTranscoder transcoder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this method can be removed.
This pull request adds
operation_id
and network tags to Couchbase requests as specified here. The main implementations differences from that RFC are:peer.service
because that would alter our current service namingpeer.address
.Version 2.6.0 of Couchbase is the first version where
operation_id
is specified on most requests so that is the base version instrumented.