-
Notifications
You must be signed in to change notification settings - Fork 775
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
Recommend pattern to redact query string parameters #2791
Comments
open-telemetry/opentelemetry-dotnet-contrib#1747 Sharing some related issues logged earlier. |
@martinjt, this is another issue I think we can close. Things have moved on since this was opened. For inbound HTTP requests, query string parameters are now redacted by default when added to the
For outbound HTTP via
|
That's a very blunt instrument, though. If you want to include everything except one query parameter (e.g. because chromium refuses to allow browser JS to set auth headers on websocket connections) then you have to "hijack" The enrichment mechanism as in the OP. |
Is there a way to opt out? |
OTEL_DOTNET_EXPERIMENTAL_ASPNETCORE_DISABLE_URL_QUERY_REDACTION See: |
thanks, @swythan! I asked and then found the corresponding environment variables myself. I asked a question about them here: open-telemetry/semantic-conventions#860 (comment) |
Question
We're evaluating a migration from New Relic APM agents to OpenTelemetry. This APM agent provides fine-grained control over what properties are included or excluded to our telemetry. This includes properties like query string parameters, ports, etc.
I see that the dotnet Http instrumentation library provides filters to remove requests entirely and also an
Enrich
option to add additional properties.I've been able to hijack this
Enrich
property to override the value for thehttp.url
to remove query string params—this seems to accomplish the desired effect. I'm curious if there are any recommended patterns for how to accomplish this in the instrumentation library itself or if it is better handled via attribute processors in an OTEL config.Describe any aspect of your environment relevant to the question.
What are you trying to achieve?
Remove query string parameters that are automatically added via HTTP client instrumentation (preferably with minimal application code on my part 😁)
Additional Context
N/A
The text was updated successfully, but these errors were encountered: