opentelemetry-cpp-contrib
opentelemetry-cpp-contrib copied to clipboard
Traceparent is incorrect when the incoming request contains large headers
Describe your environment
Docker
Nginx 1.23.1 (official image)
OpenTelemetry Webserver 1.0.3 x64 Linux
Node.js / Express app acting as a "backend" (Nginx proxy_pass requests to this backend)
Request > Nginx > Express app
Steps to reproduce
- Set up Nginx and OpenTelemetry module as per the guide on https://opentelemetry.io/blog/2022/instrument-nginx/
- Start the application
- Using Postman or your HTTP client of choice, set up a request which includes a really large header (lots of key/value header pairs). For example, paste the following into the header "Bulk Edit" feature in Postman for speed:
aaaa: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbb: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
cccc: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
dddd: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
eeee: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
ffff: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
gggg: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
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aaaaaaaaaaaaaaaaaaaa
What is the expected behavior?
The traceparent header logged within Nginx access logs and received by the backend application on its incoming request is valid and contains a single trace, for example 00-82c5500f40667e5500e9ae8e9711553c-992631f881f78c3b-01
What is the actual behavior?
The traceparent header contains lots of comma-separated traces, belonging to each of the internal Nginx modules, for example: 00-82c5500f40667e5500e9ae8e9711553c-992631f881f78c3b-01, 00-82c5500f40667e5500e9ae8e9711553c-6ec482f97a7806d7-01, 00-82c5500f40667e5500e9ae8e9711553c-02493c5c29e4be9e-01, 00-82c5500f40667e5500e9ae8e9711553c-585000d699b02a5e-01, 00-82c5500f40667e5500e9ae8e9711553c-d5e2b37e1d74fe9c-01
Additional context Seems to be the exact same symptoms as the issue discussed here https://opentelemetry.io/blog/2022/debug-otel-with-otel/, but only reproducible with a large set of headers. Using a small set of headers does not trigger this bug.
Seeing this same issue, any resolution @jbmsuk ?