Skip to content

[Vert.x] Incorrect trace propagation during message transmission #14524

@skipkolch

Description

@skipkolch

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

  1. Download reproducer project
  2. Start WorkerTraceMain.java
    $ gradle startWorkerTraceMain
  3. Start VertxHttpServer.java
    $ gradle startHttpServer
  4. Start sending http requests in parallel
    $ bash curl_requests.sh
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageNew issue that requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions