Skip to content
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

Load couchbase otel instrumentation for 3.1 #2524

Merged
merged 2 commits into from
Mar 9, 2021

Conversation

anuraaga
Copy link
Contributor

@anuraaga anuraaga commented Mar 8, 2021

tracing-opentelemetry-0.3.3 only supports couchbase 3.1, not 3.0. It seems quite tricky to deal with external library instrumentation if they have version alignment requirements, which is fairly reasonable. Let's see how it goes I guess.

Fixes #2520


public class CouchbaseEnvironmentInstrumentation implements TypeInstrumentation {
@Override
public ElementMatcher<ClassLoader> classLoaderOptimization() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really optimizing anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops - at first was going to do a subclass check but realized I shouldn't need it

Comment on lines +23 to +29
@Override
protected String[] additionalHelperClassNames() {
return new String[] {
"com.couchbase.client.tracing.opentelemetry.OpenTelemetryRequestSpan",
"com.couchbase.client.tracing.opentelemetry.OpenTelemetryRequestTracer"
};
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting: if we're going to include external library instrumentations in the javaagent (and we're probably going to do that, since it seems to be a good way to make the agent a bit slimmer & simpler) then we need to improve muzzle a bit.
Right now muzzle not only does not collect helper classes from 3rd party packages, it also collects no references whatsoever. Which means that we actually don't have the muzzle check both in build time and runtime.
It should be possible to define the set of packages for each module, by default it'd be same as InstrumentationClassPredicate - I'm going to open an issue for that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out there already was one: #1395
I've just added my 3 cents there

@anuraaga
Copy link
Contributor Author

anuraaga commented Mar 9, 2021

As we added to #1395 will go ahead and merge this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instrumentation for Couchbase Client 3.x
3 participants