-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undici instrumentation can add duplicate trace-context headers, which can break Elasticsearch #3964
Comments
Actually, I might be wrong in my assumption that undici@6 gets the situation we want. For example, using
the target
|
The ES issue is here, BTW: elastic/elasticsearch#107338 |
trentm
added a commit
that referenced
this issue
Apr 10, 2024
…ented HTTP requests ... because Elasticsearch borks on these requests. This case should only be possible in a weird case like having two APM agents active. Fixes: #3964
Merged
PeterEinberger
pushed a commit
to fpm-git/apm-agent-nodejs
that referenced
this issue
Aug 20, 2024
…ented HTTP requests (elastic#3965) ... because Elasticsearch borks on these requests. This case should only be possible in a weird case like having two APM agents active. Fixes: elastic#3964
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sending duplicate
traceparent
headers in an HTTP request to Elasticsearch breaks the request, e.g.:This can happen with undici@5, because undici instrumentation uses
request.addHeader(k, v)
to add trace-context headers and in undici@5 that API does not check for duplicate headers. (The reason it doesn't is that in undici@5 therequest.headers
are maintained as a string;.addHeader()
just appends another header.The reason one can get duplicate
traceparent
headers is if something else in the application is addingtraceparent
. It could be the user themselves, e.g. via elasticsearch client observability events which I think can be used this way, or it could be via a second APM agent in play.The text was updated successfully, but these errors were encountered: