Skip to content

Conversation

@DanielMicrosoft
Copy link
Contributor

@DanielMicrosoft DanielMicrosoft commented Dec 28, 2025

Description

Fixes #23555

Previously, the value in telemetry for ClientRequestId would be derived from the client side x-ms-client-request-id, however it would be overwritten by the x-ms-request-id coming back from the server side.

This would also set Properties['x-ms-client-request-id'] in telemetry to be that value from the server response x-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-id as the ClientRequestId in telemetry, and preserve it in the Properties['x-ms-client-request-id'] value also.

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copilot AI review requested due to automatic review settings December 28, 2025 23:41
@azure-client-tools-bot-prd
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copy link
Contributor

Copilot AI left a 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 OnResponseCreated to prevent overwriting ClientRequestId if it's already populated
  • Preserves the client-side request ID as the source of truth for telemetry

Copilot AI review requested due to automatic review settings December 29, 2025 00:37
@isra-fel
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Contributor

Copilot AI left a 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.

@DanielMicrosoft DanielMicrosoft marked this pull request as ready for review December 29, 2025 02:03
@YanaXu
Copy link
Contributor

YanaXu commented Dec 29, 2025

@dolauli , could you review this PR? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telemetry data is not correct for cmdlet "Get-AzStreamAnalyticsJob".

3 participants