Skip to main content

collection_partition_region_metrics

Creates, updates, deletes, gets or lists a collection_partition_region_metrics resource.

Overview

Namecollection_partition_region_metrics
TypeResource
Idazure.cosmos_db.collection_partition_region_metrics

Fields

The following fields are returned by SELECT queries:

The partition-level metrics for the collection and region were retrieved successfully.

NameDatatypeDescription
nameobjectThe name information for the metric.
endTimestring (date-time)The end time for the metric (ISO-8601 format).
metricValuesarrayThe metric values for the specified time window and timestep.
partitionIdstringThe partition id (GUID identifier) of the metric values.
partitionKeyRangeIdstringThe partition key range id (integer identifier) of the metric values.
startTimestring (date-time)The start time for the metric (ISO-8601 format).
timeGrainstringThe time grain to be used to summarize the metric values.
unitstringThe unit of the metric.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectsubscriptionId, resourceGroupName, accountName, region, databaseRid, collectionRid, $filterRetrieves the metrics determined by the given filter for the given collection and region, split by partition.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
$filterstringAn OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.
accountNamestringCosmos DB database account name.
collectionRidstringCosmos DB collection rid.
databaseRidstringCosmos DB database rid.
regionstringCosmos DB region, with spaces between words and each word capitalized.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
subscriptionIdstringThe ID of the target subscription.

SELECT examples

Retrieves the metrics determined by the given filter for the given collection and region, split by partition.

SELECT
name,
endTime,
metricValues,
partitionId,
partitionKeyRangeId,
startTime,
timeGrain,
unit
FROM azure.cosmos_db.collection_partition_region_metrics
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND accountName = '{{ accountName }}' -- required
AND region = '{{ region }}' -- required
AND databaseRid = '{{ databaseRid }}' -- required
AND collectionRid = '{{ collectionRid }}' -- required
AND $filter = '{{ $filter }}' -- required
;