Log Analytics - Cosmos DB Partition Key Statistics

Copper Contributor

Hello,

 

in our IoT Platform based on Azure we are ingesting a massive amount of information on a daily basis. This information is partially stored in Cosmos DB, therefore I would like to control the size of the different partitions in the Cosmos DB collections due to the 10GB restriction per partition that currently Cosmos has.

 

With this objective, I have enabled the Diagnostics Settings in the Cosmos DB service, more in particular, the PartitionKeyStatistics to be send to Log Analytics. I did this roughly a week ago.

 

My problem is that I don't know how to exploit this information in Log Analytics. I can't find the log genereated by Cosmos DB in order to exploit it in a query.

 

Has anybody used this log before? Any help would be appreciated.

 

Regards,

1 Reply

@apalomo 

 

There are some example sin the docs:

https://docs.microsoft.com/en-us/azure/cosmos-db/logging#view-logs-in-azure-monitor-logs

 

The logs are found here with this base query:

 

AzureDiagnostics
| where ResourceProvider=="MICROSOFT.DOCUMENTDB"

 

This extra query shows which Categories you have?

Go to Log Analytics and Run Query