-
Notifications
You must be signed in to change notification settings - Fork 227
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
including parsed "cookie" HTTP request header in ingest can lead to mapping conflicts #4006
Comments
I do agree with this statement. Also I think we should notice the .NET and Java teams since these agents do the same key/value mapping for cookies.
Also agreed. With the serialized value customers are able to de a text based search on the cookie value |
Some related APM server changes: elastic/apm-server#12102 elastic/apm-server#12157 In a future APM server release
|
…ible mapping conflict (elastic#4007) Refs: elastic#3322 Fixes: elastic#4006
Take this "cookie" HTTP request header value:
As of #3322, this has been included in intake v2 transaction objects as:
This results in the APM server rejecting the transaction object due to a mapping conflict, with a log error something like:
The issue is that the current mapping:
attempts to add
http.request.cookies.foo
andhttp.request.cookies.foo.bar
to the document, requiringhttp.request.cookies.foo
to be a string and an object.The behaviour ends up being subtle, because the intake request responds with 202 -- i.e. the APM agent doesn't see any issue. The transaction name ends up being visible in the Kibana APM app -- because transaction metrics are still created for it. However, the trace waterfall cannot be rendered, because of the missing document in the
traces-apm-default
data stream.(Aside: The
[REDACTED]
value is according to the https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#sanitize-field-names config var. Whether it is redacted is unrelated to this issue.)proposal
Given that including
context.request.cookies.*
can result in a subtle issue, I think we should stop including it and go back to just includingcontext.request.headers.cookie
. Two options here:context.request.headers.cookie
and[REDACTED]
, i.e. fully redact it every time.[REDACTED]
. In the example above this would be'sessionid=[REDACTED]; foo=somevalue; foo.bar=some-other-value'
.The former is less processing, but not by much. Currently we are already parsing the cookie header.
I favour doing option 2.
The text was updated successfully, but these errors were encountered: