-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[Az.Accounts] Fix ClientRequestId being overwritten in telemetry payload
#29014
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
base: main
Are you sure you want to change the base?
[Az.Accounts] Fix ClientRequestId being overwritten in telemetry payload
#29014
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes an issue where the ClientRequestId telemetry value was being incorrectly overwritten by server-side response headers. The fix ensures that once ClientRequestId is set from client-side request headers in OnBeforeCall, it will not be overwritten when OnResponseCreated processes the response headers.
Key changes:
- Added a guard condition in
OnResponseCreatedto prevent overwritingClientRequestIdif it's already populated - Preserves the client-side request ID as the source of truth for telemetry
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
|
@dolauli , could you review this PR? Thanks. |
Description
Fixes #23555
Previously, the value in telemetry for
ClientRequestIdwould be derived from the client sidex-ms-client-request-id, however it would be overwritten by thex-ms-request-idcoming back from the server side.This would also set
Properties['x-ms-client-request-id']in telemetry to be that value from the server responsex-ms-request-id.This issue would be inherited by AutoRest generated modules.
This PR will adjust behaviour of setting telemetry values to use the client side
x-ms-client-request-idas theClientRequestIdin telemetry, and preserve it in theProperties['x-ms-client-request-id']value also.Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.