Replies: 1 comment 1 reply
-
First of all, it's not that easy to do propagation and tracing in the reactive/async programming, and honestly I'm not sure if the instrumentation can properly support it.
The only solution would be for us to support tracing Micronaut Data query executions and include them in the OpenTelemetry context. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
In my current setup I am using Micronaut 4 + Hibernate Reactive. I was trying to enable OTEL tracing for DB operations using java Agent (https://github.com/open-telemetry/opentelemetry-java-instrumentation). Starting with version 1.30.0 OTEL Java Agent instrument Hibernate Reactive and Vert.x operations. Unfortunately I was not able make this combination work. Hibernate traces not appears at all. Vert.x traces appears without link to parent.
After some debugging I found that Micronaut use SessionFactory.openSession() to obtains session. From other side OTEL Hibernate Reactive instrumentation instrument SessionFactory.withSession(), but doesn't instrument SessionFactory.openSession(). Based on Hibernate documentation both of this cases definitely valid, but withSession() is preferred way because in that case Hibernate will take care about Vert.x local context.
That is what Hibernate documentation say:
"When you create a session using withSession() or withTransaction(), it’s automatically associated with the current Vert.x local context and propagates with the local context."
"On the other hand, if you use openSession(), you’ll have to manage the association between sessions and contexts yourself."
So my questions are:
Any ideas guys?
Beta Was this translation helpful? Give feedback.
All reactions