-
Notifications
You must be signed in to change notification settings - Fork 870
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
Make the JDBC driver config work with the OTel starter #9625
Make the JDBC driver config work with the OTel starter #9625
Conversation
...on/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/OpenTelemetryDriver.java
Outdated
Show resolved
Hide resolved
|
||
tasks.test { | ||
useJUnitPlatform() | ||
setForkEvery(1) |
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.
...tion/spring/autoconfigure/instrumentation/jdbc/OpenTelemetryJdbcDriverAutoConfiguration.java
Show resolved
Hide resolved
smoke-tests-otel-starter/src/main/resources/application-jdbc-driver-config.properties
Show resolved
Hide resolved
@open-telemetry/java-instrumentation-maintainers and @open-telemetry/java-instrumentation-approvers, would you have other comments? |
I have tried to do an implementation in the same way as for logging with an |
...on/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/OpenTelemetryDriver.java
Show resolved
Hide resolved
...on/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/OpenTelemetryDriver.java
Outdated
Show resolved
Hide resolved
...on/jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/OpenTelemetryDriver.java
Outdated
Show resolved
Hide resolved
...tion/spring/autoconfigure/instrumentation/jdbc/OpenTelemetryJdbcDriverAutoConfiguration.java
Show resolved
Hide resolved
@Bean | ||
OpenTelemetryInjector injectOtelIntoJdbcDriver() { | ||
return openTelemetry -> OpenTelemetryDriver.install(openTelemetry); | ||
} |
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.
can the approach used for logging work here?
Lines 29 to 36 in 0ec55db
@Bean | |
ApplicationListener<ApplicationReadyEvent> log4jOtelAppenderInitializer( | |
OpenTelemetry openTelemetry) { | |
return event -> { | |
io.opentelemetry.instrumentation.log4j.appender.v2_17.OpenTelemetryAppender.install( | |
openTelemetry); | |
}; | |
} |
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.
It's the first thing I have tried. It does not work.
Co-authored-by: Trask Stalnaker <[email protected]>
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've tested it with Quarkus with no side effects. Thanks @jeanbisutti !
Thank you @brunobat for having tested that these changes won't break things on Quarkus! |
@@ -48,6 +52,8 @@ public final class OpenTelemetryDriver implements Driver { | |||
// visible for testing | |||
static final OpenTelemetryDriver INSTANCE = new OpenTelemetryDriver(); | |||
|
|||
private OpenTelemetry openTelemetry = OpenTelemetry.noop(); |
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.
Shouldn't it be volatile
?
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.
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.
…y#9625) Co-authored-by: Trask Stalnaker <[email protected]>
No description provided.