Is there documentation for the 'x-ms-request-duration-ms' response header value?

William Bourdo 1 Reputation point
2021-08-26T14:13:08.433+00:00

I have already searched through the knowledge base for this header value with no results. Specifically this article doesn't have clear documentation or a clear path to explore to find the answer https://learn.microsoft.com/en-us/rest/api/cosmos-db/common-cosmosdb-rest-response-headers

I am getting this value in the last_response_headers dictionary within the CosmosClientConnection object belonging to the ContainerProxy object I'm instantiating while using the azure-cosmos python library.

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,543 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 51,346 Reputation points
    2021-08-26T14:41:57.88+00:00

    Looks like you're using the graph API to access Cosmos DB. Based upon the header name I suspect this is the duration (in ms) that the request took to process. This lines up with the similar x-ms-request- fields that report the "costs" of the call. This is important for servicing limits because if your request takes too long it'll fail. Returning this info tells you how long the request took. If it is getting close to the limits then you might need to do some optimizations on the queries and/or adjust your graph nodes.

    0 comments No comments