Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change trace-id header in opentracing?

Is there way to configure opentracing-spring-jaeger-cloud-starter to handle any other header than Uber-Trace-Id? I have Traefik as an ingress in my kubernetes cluster. Traefik can be configured to change traceContextHeaderName. Default value is "uber-trace-id". When I change it to some custom, there is no connection (I mean span connection) between services. I believe that opentracing works only with Uber-Trace-Id. Is there way to configure that?

I test this in minikube with Traefik as an ingress. Then all requests go to spring-cloud-gateway and are propagate to services.

Thanks for help!

like image 793
kamyl Avatar asked Jul 03 '19 05:07

kamyl


People also ask

What is traceparent header?

The traceparent header represents the incoming request in a tracing system in a common format, understood by all vendors. Here's an example of a traceparent header. traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01.

What is a trace id?

Trace ID is a system number Treasury uses to identify invoice documents in PeopleSoft. For invoice documents sent from SAP the Trace ID will consist of: PC1 to identify SAP, the fiscal year the document posts in SAP (the fiscal year it clears to Treasury from SAP), and the SAP clearing document number.

Is OpenTracing deprecated?

OpenTracing is now deprecated, and users of OpenTracing are advised to migrate to OpenTelemetry.

What is a span in OpenTracing?

Traces, spans, and edges During the journey of the transaction, it can create one or multiple spans. A span represents a single unit of work inside a transaction, for example, an RPC client/server call, sending query to the database server, or publishing a message to the message bus.


1 Answers

No, there is no out-of-the-box possibility to change the HTTP header name. However, you can enable B3 header propagation with opentracing.jaeger.enable-b3-propagation=true. To configure Traefik to send the trace data as B3 headers, see https://github.com/containous/traefik/blob/master/docs/content/observability/tracing/jaeger.md#propagation. traceContextHeaderName should also be configured as X-B3-TraceId then.

like image 56
TYsewyn Avatar answered Sep 23 '22 00:09

TYsewyn