Open patwapro opened 1 year ago
Please follow the below sample to correctly get the list_metrics.
The code should be like this:
metrics = client.collection_partition.list_metrics(
resource_group,
account_name,
database_rid,
container_rid,
"$filter=(name.value eq 'Data Size') and timeGrain eq duration'P1D' and startTime eq '2023-01-01T13:53:55.2780000Z' and endTime eq '2023-01-31T15:58:55.2780000Z'"
)
for metric in metrics:
print(metric)
You have to include the "$filter=" in the filter string.
I got this issue:
HttpResponseError: (BadRequest) Failed to parse query $filter=(value eq 'data size') and timegrain eq 'p1d' and starttime eq '2023-01-01t13:53:55.2780000z' and endtime eq '2023-01-31t15:58:55.2780000z' ActivityId: c6a9ae91-a912-11ed-b4cf-5414f357addb, Microsoft.Azure.Documents.Common/2.14.0 Code: BadRequest Message: Failed to parse query $filter=(value eq 'data size') and timegrain eq 'p1d' and starttime eq '2023-01-01t13:53:55.2780000z' and endtime eq '2023-01-31t15:58:55.2780000z' ActivityId: c6a9ae91-a912-11ed-b4cf-5414f357addb, Microsoft.Azure.Documents.Common/2.14.0
Hi, I am using CollectionPartitionOperations -> list_metrics.
Not printing anything.
I set 80,000 throughputs in my container.
We are using: Python Azure SDK - azure-mgmt-cosmosdb==6.4.0 The document we follow: https://learn.microsoft.com/en-us/python/api/azure-mgmt-cosmosdb/azure.mgmt.cosmosdb.operations.collectionpartitionoperations?view=azure-python