Request Latency is missing in v3 responses
See original GitHub issueIs your feature request related to a problem? Please describe.
In v2 of the library, responses had a RequestLatency
field which showed the latency of the raw request against Cosmos DB. In v3, it seems that this field is no longer available. I see that internally, the library is storing this value within the specific CosmosDiagnostics
class for each response type, but it’s not publicly accessible without deserializing through CosmosDiagnostics.ToString()
, which is not a performant or efficient solution.
Describe the solution you’d like
The Response<'T>
type should expose the RequestLatency
value, or else provide an easily consumable form of CosmosDiagnostics
that is not internal.
Describe alternatives you’ve considered
Deserializing the CosmosDiagnostics.ToString()
, but the cost to do this for every single request is too heavy.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
@ylibrach You can get the required statistics for Autoscale from Azure Monitor: https://docs.microsoft.com/en-us/azure/cosmos-db/logging#interpret which can be read programmatically to generate an autoscale logic.
I have trouble understanding point # 1. RequestLatency is the time it takes for the request to go from the origin and get back, if there is a network blip or your connections/sockets are starved, that latency will be affected. How is that related to RU consumption and self throttling? That seems to be related to RequestCharge.
We actually have both: