Database Accounts - List Metric Definitions
Retrieves metric definitions for the given database account.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions?api-version=2024-08-15
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
account
|
path | True |
string |
Cosmos DB database account name. Regex pattern: |
resource
|
path | True |
string |
The name of the resource group. The name is case insensitive. |
subscription
|
path | True |
string |
The ID of the target subscription. |
api-version
|
query | True |
string |
The API version to use for this operation. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
The metric definitions for the database account were retrieved successfully. |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | Impersonate your user account |
Examples
CosmosDBDatabaseAccountGetMetricDefinitions
Sample request
Sample response
{
"value": [
{
"metricAvailabilities": [
{
"timeGrain": "PT5M",
"retention": "P2D"
},
{
"timeGrain": "PT1H",
"retention": "P14D"
},
{
"timeGrain": "P1D",
"retention": "P60D"
}
],
"primaryAggregationType": "Total",
"unit": "Count",
"resourceUri": "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1",
"name": {
"value": "Total Requests",
"localizedValue": "Total Requests"
}
}
]
}
Definitions
Name | Description |
---|---|
Metric |
The availability of the metric. |
Metric |
The definition of a metric. |
Metric |
The response to a list metric definitions request. |
Metric |
A metric name. |
Primary |
The primary aggregation type of the metric. |
Unit |
The unit of the metric. |
MetricAvailability
The availability of the metric.
Name | Type | Description |
---|---|---|
retention |
string |
The retention for the metric values. |
timeGrain |
string |
The time grain to be used to summarize the metric values. |
MetricDefinition
The definition of a metric.
Name | Type | Description |
---|---|---|
metricAvailabilities |
The list of metric availabilities for the account. |
|
name |
The name information for the metric. |
|
primaryAggregationType |
The primary aggregation type of the metric. |
|
resourceUri |
string |
The resource uri of the database. |
unit |
The unit of the metric. |
MetricDefinitionsListResult
The response to a list metric definitions request.
Name | Type | Description |
---|---|---|
value |
The list of metric definitions for the account. |
MetricName
A metric name.
Name | Type | Description |
---|---|---|
localizedValue |
string |
The friendly name of the metric. |
value |
string |
The name of the metric. |
PrimaryAggregationType
The primary aggregation type of the metric.
Name | Type | Description |
---|---|---|
Average |
string |
|
Last |
string |
|
Maximum |
string |
|
Minimum |
string |
|
None |
string |
|
Total |
string |
UnitType
The unit of the metric.
Name | Type | Description |
---|---|---|
Bytes |
string |
|
BytesPerSecond |
string |
|
Count |
string |
|
CountPerSecond |
string |
|
Milliseconds |
string |
|
Percent |
string |
|
Seconds |
string |