-
Notifications
You must be signed in to change notification settings - Fork 524
Tracing: Adds tracing improvements for pkrange refresh calls #5511
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
Tracing: Adds tracing improvements for pkrange refresh calls #5511
Conversation
kirankumarkolli
left a comment
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.
Please check comments
Microsoft.Azure.Cosmos/src/MetadataRequestThrottleRetryPolicy.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/src/MetadataRequestThrottleRetryPolicy.cs
Outdated
Show resolved
Hide resolved
xinlian12
left a comment
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.
LGTM, thanks,
xinlian12
left a comment
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.
LGTM, thanks :)
# Pull Request Template ## Description This pull request adds enhanced trace logging to improve observability and debugging of metadata request routing and partition key range cache operations in the Cosmos DB SDK. The most important changes are the addition of detailed trace information for exception handling, request routing, and partition key range cache responses. **Enhanced Exception and Request Logging:** * Added trace logs to `ShouldRetryAsync` in `MetadataRequestThrottleRetryPolicy` to record `StatusCode` and `SubStatusCode` for both `CosmosException` and `DocumentClientException` when evaluating retry logic. [[1]](diffhunk://#diff-a5ed5985909c3dcb6e4ce186cdd662d590dac5297ea14e68560c7d1eca307be4R96) [[2]](diffhunk://#diff-a5ed5985909c3dcb6e4ce186cdd662d590dac5297ea14e68560c7d1eca307be4R106) * Updated trace logging in `OnBeforeSendRequest` to include `collectionName` and `collectionRid` when routing metadata requests, providing more context for diagnostics. **Partition Key Range Cache Diagnostics:** * Added trace logging in `GetRoutingMapForCollectionAsync` to output `collectionRid`, `StatusCode`, `SubstatusCode`, and the ETag value (`ChangeFeedNextIfNoneMatch`) for each response, aiding in troubleshooting partition key range cache issues. ## Type of change Please delete options that are not relevant. - [] New feature (non-breaking change which adds functionality) ## Closing issues To automatically close an issue: closes #IssueNumber
Pull Request Template
Description
This pull request adds enhanced trace logging to improve observability and debugging of metadata request routing and partition key range cache operations in the Cosmos DB SDK. The most important changes are the addition of detailed trace information for exception handling, request routing, and partition key range cache responses.
Enhanced Exception and Request Logging:
ShouldRetryAsyncinMetadataRequestThrottleRetryPolicyto recordStatusCodeandSubStatusCodefor bothCosmosExceptionandDocumentClientExceptionwhen evaluating retry logic. [1] [2]OnBeforeSendRequestto includecollectionNameandcollectionRidwhen routing metadata requests, providing more context for diagnostics.Partition Key Range Cache Diagnostics:
GetRoutingMapForCollectionAsyncto outputcollectionRid,StatusCode,SubstatusCode, and the ETag value (ChangeFeedNextIfNoneMatch) for each response, aiding in troubleshooting partition key range cache issues.Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #IssueNumber