-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Describe the bug
I integrated tracing into my Vert.x project using the vertx-tracing
library. For instrumentation, I use the @WithSpan annotation together with your Java Agent to create and export traces to collectors.
However, I noticed an issue: with this setup, different independent requests are merged into a single trace (this behavior was also described in the old issue #93).
The Vert.x team suggested not using the Java Agent and instead creating spans manually — this indeed solves the problem. But using the annotation is much more convenient, and I’d like to keep this option available.
Could you please take a look at my reproducer and advise how this can be fixed while still using the agent?
Steps to reproduce
https://github.com/skipkolch/vertx-tracer-example
- Download reproducer project
- Start WorkerTraceMain.java
$ gradle startWorkerTraceMain - Start VertxHttpServer.java
$ gradle startHttpServer - Start sending http requests in parallel
$ bash curl_requests.sh - Observe mixed traces in log/Tempo/OTLP collector
Expected behavior
- Each request is processed in its own trace.
- Trace context propagates correctly between worker and event loop verticles
Actual behavior
- Some independent requests appear merged in the same trace
- This behavior is consistently repeated with a different number of requests.
Javaagent or library instrumentation version
2.19.0
Environment
- Vert.x: 4.5.12
- Vert.x OpenTelemetry: 4.5.12
- OpenTelemetry Instrumentation: 1.32.0
- OpenTelemetry Java-agent: 2.19.0
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.