open-telemetry / open-telemetry/opentelemetry-cpp-contrib
`b3` propagator not working when internal redirect
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 153
- Forks
- 184
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 26
Description
In APIcast, the opentelemetry instrumentations is working for the default W3C propagator. When trying to switch to b3 propagation type (i.e. opentelemetry_propagate b3;) propagation stops working, even though traces are still being sent to the collector.
Describe your environment
- Platform: linux/amd64
- Openresty/Nginx version: 1.21.4
- Intrumentation: https://github.com/open-telemetry/opentelemetry-cpp-contrib/tree/main/instrumentation/nginx
Steps to reproduce
Trying to narrow down the relevant nginx configuration used in APIcast, simplified for the shake of this issue, it looks something like this:
location / {
content_by_lua_block {
ngx.exec("@otel");
}
}
location @otel {
internal;
opentelemetry_operation_name apicast;
opentelemetry_propagate b3;
proxy_pass http://example.com;
}
What is the expected behavior?
The request propagation of distributed tracing headers for the b3 type. When no parent trace is given, a new trace will be started. So, upstream request to example.com should have the B3 tracing header.
What is the actual behavior?
The distributed tracing headers (i.e. the B3 header) are not propagated and no new trace is started when no parent trace is given. So, the upstream request to example.com does not have the B3 header. Furthermore, if there is a parent trace, the upstream request to example.com has the B3 header being removed.
Additional context
This same configuration for W3C propagation type works like a charm.
location / {
content_by_lua_block {
ngx.exec("@otel");
}
}
location @otel {
internal;
opentelemetry_operation_name apicast;
opentelemetry_propagate;
proxy_pass http://example.com;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the simplified nginx configuration in the issue and the linked OpenTelemetry Nginx instrumentation. Reproduce the internal redirect with opentelemetry_propagate b3 and compare it with the working W3C configuration. Done means B3 headers are propagated, a new trace starts without a parent, and an existing B3 header is not removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, nginx
- Domain
- backend, observability-sre
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100