Cosmos database_RID metrics for API (Microsoft.DocumentDB)

Nadia Mendez 0 Reputation points
2024-07-18T00:47:57.7066667+00:00

I’m trying to obtain data from a specific cosmosDB database, in this case I use the Total Requests metric as an example. 

With the help of the URL https://learn.microsoft.com/es-es/rest/api/cosmos-db-resource-provider/database/list-metrics?view=rest-cosmos-db-resource-provider-2024 -05-15&tabs=HTTP#code-try-0, I put the corresponding values. However the databaseRid value seems to be incorrect.

User's image

The returned result is always empty, even when the database name is correct or even if it is changed to any other value.

User's image

The questions are:

  • Is some other property needed to be able to obtain some metrics at the DB level, or is it not possible to obtain any of these?
  • The databaseRid is equal to the name given to it at the time of creation or is this an internal ID automatically placed by cosmos, if so how can this value be obtained?
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,121 questions
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,643 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 25,491 Reputation points
    2024-07-21T19:58:41.02+00:00

    For databaseRid, have you checked the interval you have put like starttime and endtime in your request ?

    For your question, regarding how to be able to obtain some metrics at the DB level, you need to have Permission to read metrics (typically requires a role such as Contributor, Owner)


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.