ingress-nginx icon indicating copy to clipboard operation
ingress-nginx copied to clipboard

Allow setting OpenTelemetry propagation type to B3

Open illrill opened this issue 2 years ago • 7 comments

I want the ability to use B3 (Zipkin) propagation headers in the ingress-nginx OpenTelemetry implementation.

The upstream opentelemetry-cpp-contrib NGINX module supports two propagation types: W3C (default) and B3, configurable with the opentelemetry_propagate directive:

opentelemetry_propagate (W3C) opentelemetry_propagate b3 (B3)

The current ingress-nginx implementation of the module hardcodes opentelemetry_propagate. We should expose a config option and potentially an ingress annotation that allows setting opentelemetry_propagate b3, perhaps in the simplest form as a boolean opentelemetry-propagate-b3: "true".

Especially considering v1.10 plans (#10186, #8687) to remove the OpenTracing implementation which does supports B3 (Zipkin) propagation.

illrill avatar Aug 16 '23 11:08 illrill

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Aug 16 '23 11:08 k8s-ci-robot

/assign

esigo avatar Aug 17 '23 19:08 esigo

@esigo does it make sense to wait for https://github.com/open-telemetry/opentelemetry-cpp-contrib/pull/103 (looks like it's been revived recently), and go ahead and implement both B3 and B3-Multi in one go?

illrill avatar Aug 23 '23 11:08 illrill

This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach #ingress-nginx-dev on Kubernetes Slack.

github-actions[bot] avatar Sep 23 '23 01:09 github-actions[bot]

I would like to revive this issue as now support for everything except OpenTelemetry is dropped and only having the hardcoded value of W3C propagation without the possibility to fallback to B3 and making Zipkin and older/custom integration unsuable. Please expose a way to configure B3/B3 propagation in config.

hawky-4s- avatar Jul 04 '24 07:07 hawky-4s-

If you just want the B3 trace and span to propagate I have found that you can add the following in the location snippet. I don't know if it provides everything you want, but it seems sufficient for that purpose. I'd rather be able to do it 'properly' though.

proxy_set_header X-B3-TraceId "$opentelemetry_trace_id";
proxy_set_header X-B3-SpanId "$opentelemetry_span_id";
proxy_set_header X-B3-Sampled "0";

crispibits avatar Sep 13 '24 07:09 crispibits

/remove-lifecycle frozen This repository is heading for archival; seee https://kubernetes.io/blog/2025/11/11/ingress-nginx-retirement/

lmktfy avatar Nov 29 '25 18:11 lmktfy