Sanitize query parameters in url.full telemetry#4088
Open
heaths wants to merge 1 commit intoAzure:mainfrom
Open
Sanitize query parameters in url.full telemetry#4088heaths wants to merge 1 commit intoAzure:mainfrom
heaths wants to merge 1 commit intoAzure:mainfrom
Conversation
Uses `LoggingOptions::additional_allowed_query_params`.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates azure_core distributed tracing instrumentation to sanitize query parameter values in the url.full span attribute, aligning trace output with the existing logging allow-list behavior.
Changes:
- Plumbs an allow-list of query parameter names into
RequestInstrumentationPolicyand usesSanitizer::sanitizewhen settingurl.full. - Derives the allow-list from
DEFAULT_ALLOWED_QUERY_PARAMETERSplusLoggingOptions::additional_allowed_query_paramsduringClientOptions::deconstruct. - Updates/extends tests to validate default redaction behavior and custom allow-list behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/core/azure_core/src/http/policies/instrumentation/request_instrumentation.rs | Adds allow-list support to request instrumentation and sanitizes url.full; updates and adds tests. |
| sdk/core/azure_core/src/http/policies/instrumentation/public_api_instrumentation.rs | Updates tests to construct RequestInstrumentationPolicy with the new allow-list parameter. |
| sdk/core/azure_core/src/http/pipeline.rs | Passes the merged allow-list into RequestInstrumentationPolicy when building the pipeline. |
| sdk/core/azure_core/src/http/options/mod.rs | Computes merged allowed query params (defaults + logging additions) and stores them in CoreClientOptions. |
| sdk/core/azure_core/src/http/options/instrumentation.rs | Documents that logging query allow-list impacts traced URL sanitization. |
| sdk/core/azure_core/CHANGELOG.md | Adds an entry describing the new sanitization behavior. |
jsquire
approved these changes
Apr 3, 2026
Member
jsquire
left a comment
There was a problem hiding this comment.
I wouldn't trust my Rust knowledge beyond some very shallow recognition, but the comments that describe the intent seem to match the flow and sanitize appears to be called in the expected locations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uses
LoggingOptions::additional_allowed_query_params.