Skip to content

Conversation

@gastaldi
Copy link

@gastaldi gastaldi commented Dec 8, 2025

There are cases where the Global OpenTelemetry may not have been initialized yet, so it's better to initialize lazily

There are cases where the Global OpenTelemetry may not have been initialized yet, so it's better to initialize lazily
@mysql-oca-bot
Copy link

Hi, thank you for submitting this pull request. In order to consider your code we need you to sign the Oracle Contribution Agreement (OCA). Please review the details and follow the instructions at https://oca.opensource.oracle.com/
Please make sure to include your MySQL bug system user (email) in the returned form.
Thanks

@gastaldi gastaldi closed this Dec 9, 2025
@gastaldi
Copy link
Author

gastaldi commented Dec 9, 2025

This doesn't solve the problem, because the OpenTelemetry API is called when the JDBC connection is created:

22:09:34,972 INFO  [app] java.lang.Exception: Stack trace
22:09:34,972 INFO  [app] 	at java.base/java.lang.Thread.dumpStack(Thread.java:2210)
22:09:34,972 INFO  [app] 	at com.mysql.cj.otel.OpenTelemetryHandler.getOpenTelemetry(OpenTelemetryHandler.java:84)
22:09:34,972 INFO  [app] 	at com.mysql.cj.otel.OpenTelemetryHandler.getTracer(OpenTelemetryHandler.java:92)
22:09:34,972 INFO  [app] 	at com.mysql.cj.otel.OpenTelemetryHandler.startSpan(OpenTelemetryHandler.java:51)
22:09:34,973 INFO  [app] 	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:359)
22:09:34,973 INFO  [app] 	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237)
22:09:34,973 INFO  [app] 	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:180)
22:09:34,973 INFO  [app] 	at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:225)

@gastaldi gastaldi deleted the opentelemetry_init branch December 9, 2025 01:11
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.

2 participants