Azure Cosmos DB Collection Count

Helllo,

I am trying to use New Relic to monitor the number of collections within an Azure Cosmos DB.

I am using the following NRQL:

Select uniqueCount(collectionName) FROM AzureCosmosDbCollectionSample

The issue is the count seems to keeps changing.

Is there a more accurate way of getting this figure?

1 Like

Hi Neil,

I’d suggest adding a time window to this query (perhaps slightly exceeding the frequency of data collection for this metric) which could help smooth out the data. For example, if the integration is picking up events every 15 minutes, appending

SINCE 30 minutes ago LIMIT max

to the query should ensure that all samples in the last 15 minutes are queried.