How Monitor - Cosmos DB (preview) Requests is calculated? RRS feed

  • Question

  • Azure monitor the incoming request to the Cosmos. When I am alone working on my Cosmos DB, ran a simple select vertex statement(eg., g.V('id')). Then I monitored the incoming request, it shows around 10. But for sure i'm the only person accessing. I also tried traversing through the graph in a single select query the Request count is huge(around 100).

    Can you tell me how the request is calculated for Gremlin API?

    Friday, November 22, 2019 10:03 AM

All replies

  • Hi Sabarish,

    What you are likely seeing are RUs per request, as one request may account for more than 1 RU charge. Please see the sample queries section of the document. 

    To query for the 10 most recently logged events:

    AzureDiagnostics | where ResourceProvider=="MICROSOFT.DOCUMENTDB" and Category=="DataPlaneRequests" | take 10

    which will detail all the events you have initiated, for verification that it is only you performing any operations followed by:

    To get all queries greater than 100 RUs joined with data from DataPlaneRequests and QueryRunTimeStatistics.

    | where ResourceProvider=="MICROSOFT.DOCUMENTDB" and Category=="DataPlaneRequests" and todouble(requestCharge_s) > 100.0
    | project activityId_g, requestCharge_s
    | join kind= inner (
        | where ResourceProvider =="MICROSOFT.DOCUMENTDB" and Category == "QueryRuntimeStatistics"
        | project activityId_g, querytext_s
    ) on $left.activityId_g == $right.activityId_g
    | order by requestCharge_s desc
    | limit 100

    And this query can be modified to include request charges greater than 1, if you wish. This will highlight each or your operations and detail the request charge for each. Please see the following documentation to understand how Request Units are charged per operation: Request Units in Azure Cosmos DB



    Friday, November 22, 2019 10:36 PM
  • Please let me know if you have additional questions.



    Thursday, November 28, 2019 2:28 AM