-
Notifications
You must be signed in to change notification settings - Fork 481
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
Diagnostics: Adds Gateway Request Stats #2324
Conversation
Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs
Show resolved
Hide resolved
...oft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayClientSideRequestStats.cs
Outdated
Show resolved
Hide resolved
...oft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayClientSideRequestStats.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs
Outdated
Show resolved
Hide resolved
Do the address resolution statics cover these? |
@@ -169,7 +169,7 @@ public static HttpMessageHandler CreateHttpClientHandler(int gatewayModeMaxConne | |||
INameValueCollection additionalHeaders, | |||
ResourceType resourceType, | |||
HttpTimeoutPolicy timeoutPolicy, | |||
ITrace trace, |
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.
When to use ITrace vs IClientSideRequestStatistics?
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.
IClientSideRequestStatistics will be used for any contracts with the Direct package. Taking a dependency on ITrace will cause a circle reference which make it difficult to make any contract changes. This allows the v2 SDK to get the additional tracing. If it is decided that ITrace should replace IClientSideRequestStatistics it will require refactoring the v2 SDK and the entire Direct package.
jsonWriter.WriteStringValue(stat.Exception.GetType().ToString()); | ||
|
||
jsonWriter.WriteFieldName("ExceptionMessage"); | ||
jsonWriter.WriteStringValue(stat.Exception.Message); |
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.
If it worth instead capturing the ToString instead of the Message? Or the stack trace?
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.
Is the size a concern? Stack trace and tostring which also prints the stack trace can be very large.
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.
Not the size, but rather, would we have enough troubleshooting information just from the message
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.
This will only include exception thrown by the HttpClient so I think it will be ok to just record the message. The Trace structure will let us know where it was thrown from.
...oft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayClientSideRequestStats.cs
Outdated
Show resolved
Hide resolved
…om/Azure/azure-cosmos-dotnet-v3 into users/askagarw/GatewayRequestStats
|
||
Debug.Assert(System.Diagnostics.Trace.CorrelationManager.ActivityId != Guid.Empty, "Trace activity id is missing"); | ||
CosmosException cosmosException = CosmosExceptionFactory.CreateRequestTimeoutException( | ||
message: ex.Data?["Message"].ToString(), |
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.
Why not just ex.Message?
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 verify that there is no perf impact in steady state.
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 verify that there is no perf impact in steady state.
I verified the end to end perf shows no changes in steady state. |
Pull Request Template
The current client side request stats does not record http operations. This is extending the contract to include all http operations which is necessary for troubleshooting latency issues. It was chosen to extend the IClientSideRequestStats rather than wiring though ITrace because of the dependencies in the direct package. Using ITrace would require wiring through all the shared code which is much larger task.
Diagostics Changes