Tracing across async hops
One order as one trace from POST /orders through the outbox, Debezium in Connect and a SmallRye consumer, with a span-link form beside it and a search by order id in Tempo.
examples/25-tracing-across-async-hops/ places an order in order-service, publishes it through the outbox and a Debezium connector, and reserves stock in inventory-service. It accompanies Tracing across async hops.
It uses Quarkus, SmallRye Reactive Messaging, Hibernate ORM with Panache, Flyway, the Debezium outbox extension, OpenTelemetry, PostgreSQL, Kafka, Kafka Connect with the OpenTelemetry Java agent, and the LGTM stack.
(cd examples/domain-model && mvn -B -q install)
cd examples/25-tracing-across-async-hops
mvn -B verify
./verify.sh
What to observe
- One trace. A TraceQL search by order id returns one trace with spans of three services.
- The ancestry. The reservation descends from the request through the outbox write and Connect’s
db-log-write. - The link form. With the consumer in link form the order’s trace ends at Connect and a second trace links back.
- Without the agent. Connect publishes the event with no
traceparentand the consumer starts an unrelated trace.
Infrastructure
Kafka, PostgreSQL, Kafka Connect with its tracing override, and the LGTM stack from examples/_infra, plus two services on ports 8080 and 8082. The compose project is edp-25.