jaegertracing / jaeger

CNCF Jaeger, a Distributed Tracing Platform

Home Page:https://www.jaegertracing.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature]: Support Context propagation for jaeger consumer

SwanHtetAung opened this issue · comments

Requirement

Use header value to create a new context instead of creating a plain background context.

Problem

Currently, when jaeger consumers consume messages from Sarma, it does not use the header provided by kafka message. It instead creates a new context.

Proposal

I believe the ingester should examine the context to appropriately configure tracing for the Jaeger system. Currently, the collector sends a message to Kafka, and the ingester consumes that message. However, because the ingester doesn't read from the context, it invariably initiates a new root span.

If tracing is activated for both the collector and the ingester, two separate traces are currently produced: one for the collector and another for the ingester.

By enabling the ingester to read from the context, It would consolidate these into a single trace. In short, it will show a path from collector -> ingester

Open questions

No response

there is nothing that ingester needs to read from the context. Please explain your use case.

  • Hey @SwanHtetAung , I would love to work on this issue, can you please elaborate more about the issue, or any reference you can provide!

there is nothing that ingester needs to read from the context. Please explain your use case

I believe the ingester should examine the context to appropriately configure tracing for the Jaeger system. Currently, the collector sends a message to Kafka, and the ingester consumes that message. However, because the ingester doesn't read from the context, it invariably initiates a new root span.

If tracing is activated for both the collector and the ingester, two separate traces are currently produced: one for the collector and another for the ingester.

By enabling the ingester to read from the context, It would consolidate these into a single trace. In short, it will show a path from collector -> ingester.

So your use case is tracing the flow through Jaeger itself - that's fair (if a bit dangerous / recursive).

what do you mean by a bit dangerous / recursive here?

You are tracing the system that captures traces - if not careful you can easily create an infinite loop. In Jaeger we historically avoided tracing of the ingestion path, only query paths are traced.

I see. Do you have example cases an infinite loop might happen? I was thinking this away.
Agent -> Collector -> Ingester -> Storage trace path should exists and use the same context(Ideally from agent). How can an infinite loop happen there?

Your applications start a trace A and report it to Jaeger. Jaeger receives the trace data, and in the pipeline you described above starts another trace B. Trace B is also reported as separate payload to Jaeger, which may start trace C for processing that payload, and so on.

I see, did not think of that case.