How find long running and high RU queries in cosmos database

237 views Asked by At

I have a cosmos database for mongo api and I am trying to find the most expensive query and the highest RU consuming query in a database.

I can see the operation which is taking the high RU from metrics but I would also like to see the query which is taking the RU.

I do have diagnostic setting enabled and capturing DataPlaneRequests and MongoRequest. I have tried the below query but it doesn't provide any results

CDBMongoRequests
  | where todouble(RequestCharge) > 10.0
  | project ActivityId, RequestCharge
  | join kind= inner (
  CDBQueryRuntimeStatistics
  | project ActivityId, QueryText
  ) on $left.ActivityId == $right.ActivityId
  | order by RequestCharge desc
  | limit 100

Can someone help on how can I find the actual queries running?

0

There are 0 answers