Description
When RequestMetadata is attached to an outgoing HttpRequestMessage but RequestRoute and RequestName are left at their default values (TelemetryConstants.Unknown), HttpRequestReader.GetRedactedPathAndParameters emits path = "unknown" instead of scrubbing it to "REDACTED". The no-metadata branch already returns "REDACTED" for the same underlying situation (URL present, no route template to safely scrub sub-parts), so the two cases should converge.
This affects callers who attach RequestMetadata only to set unrelated fields (e.g. DependencyName) — they end up with misleading "unknown" in their logs rather than the conservative scrub the framework already produces when no metadata is attached.
Reproduction Steps
request.SetRequestMetadata(new RequestMetadata { DependencyName = "Graph" });
// → path is logged as "unknown"
Expected behavior
GetRedactedPathAndParameters sets logRecord.Path to TelemetryConstants.Redacted — same as when no RequestMetadata is attached.
Actual behavior
GetRedactedPathAndParameters sets logRecord.Path to "unknown" — it falls back to RequestMetadata.RequestName, which is TelemetryConstants.Unknown by default, leaking that string into the Path dimension.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Description
When RequestMetadata is attached to an outgoing HttpRequestMessage but RequestRoute and RequestName are left at their default values (TelemetryConstants.Unknown), HttpRequestReader.GetRedactedPathAndParameters emits path = "unknown" instead of scrubbing it to "REDACTED". The no-metadata branch already returns "REDACTED" for the same underlying situation (URL present, no route template to safely scrub sub-parts), so the two cases should converge.
This affects callers who attach RequestMetadata only to set unrelated fields (e.g. DependencyName) — they end up with misleading "unknown" in their logs rather than the conservative scrub the framework already produces when no metadata is attached.
Reproduction Steps
request.SetRequestMetadata(new RequestMetadata { DependencyName = "Graph" });
// → path is logged as "unknown"
Expected behavior
GetRedactedPathAndParameters sets logRecord.Path to TelemetryConstants.Redacted — same as when no RequestMetadata is attached.
Actual behavior
GetRedactedPathAndParameters sets logRecord.Path to "unknown" — it falls back to RequestMetadata.RequestName, which is TelemetryConstants.Unknown by default, leaking that string into the Path dimension.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response