-
Notifications
You must be signed in to change notification settings - Fork 868
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
Add JdbcTelemetry and JdbcTelemetryBuilder #9685
Add JdbcTelemetry and JdbcTelemetryBuilder #9685
Conversation
...in/java/io/opentelemetry/instrumentation/jdbc/datasource/OpenTelemetryDataSourceBuilder.java
Outdated
Show resolved
Hide resolved
...in/java/io/opentelemetry/instrumentation/jdbc/datasource/OpenTelemetryDataSourceBuilder.java
Outdated
Show resolved
Hide resolved
...in/java/io/opentelemetry/instrumentation/jdbc/datasource/OpenTelemetryDataSourceBuilder.java
Outdated
Show resolved
Hide resolved
...in/java/io/opentelemetry/instrumentation/jdbc/datasource/OpenTelemetryDataSourceBuilder.java
Outdated
Show resolved
Hide resolved
@hannahchan Have a look at a few of our existing library instrumentations, for example https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/cassandra/cassandra-4.4/library/src/main/java/io/opentelemetry/instrumentation/cassandra/v4_4 Most of them follow the same style, there is a class called |
02c1bab
to
dd44b96
Compare
Thanks for pointing out the examples. I've refactored my PR to what I think is following the pattern you pointed out. The only thing I'm not sure about is the name of the class I've chosen and am happy to take suggestions here. They are currently name I'm ready for any feedback. |
dd44b96
to
1fb452d
Compare
...bc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/datasource/JdbcTelemetry.java
Outdated
Show resolved
Hide resolved
...bc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/datasource/JdbcTelemetry.java
Outdated
Show resolved
Hide resolved
...ary/src/main/java/io/opentelemetry/instrumentation/jdbc/datasource/JdbcTelemetryBuilder.java
Outdated
Show resolved
Hide resolved
...bc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/datasource/JdbcTelemetry.java
Outdated
Show resolved
Hide resolved
...ary/src/main/java/io/opentelemetry/instrumentation/jdbc/datasource/JdbcTelemetryBuilder.java
Outdated
Show resolved
Hide resolved
...ary/src/main/java/io/opentelemetry/instrumentation/jdbc/datasource/JdbcTelemetryBuilder.java
Outdated
Show resolved
Hide resolved
...ry/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/JdbcInstrumenterFactory.java
Show resolved
Hide resolved
.../src/main/java/io/opentelemetry/instrumentation/jdbc/datasource/OpenTelemetryDataSource.java
Outdated
Show resolved
Hide resolved
It looks like the build it broken and I don't know why. Is someone able to advise? |
We run tests agains latest version of instrumented libraries. When there is a new version sometimes our tests break, these failures don't prevent merging of the pull requests. |
We're currently using the JDBC library instrumentation in our application and unlike the agent instrumentation, it doesn't have an option to turn off the noisy
getConnection
spans. In the agent there is an option to disablejdbc-datasource
and leave onjdbc
.This PR attempts to solve this by introducing an
OpenTelemetryDataSourceBuilder
in the library instrumentation so that consumers can through code, disable these spans.