question

JigneshVala-3362 avatar image
0 Votes"
JigneshVala-3362 asked KalyanChanumolu-MSFT edited

Need to set a azure monitoring alert on cosmos db's container level to identify issue of 'Partition key reached maximum size of 20 GB'

Hi Team,

Need to set a azure monitoring alert on cosmos db's container level to identify issue of 'Partition key reached maximum size of 20 GB'

Actually, we need to identify this issue before it reached to 20 GB so it would be good if we received alert on 16 GB or 18 GB so development team can look into this issue quickly before it reached to 20GB.

Thanks in advance.

Best Regards,
Jignesh Vala

azure-cosmos-db
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KalyanChanumolu-MSFT avatar image
0 Votes"
KalyanChanumolu-MSFT answered KalyanChanumolu-MSFT edited

@JigneshVala-3362 Thank you for reaching out.

You can set up alerting on the PartitionKey Size by creating an Alert Rule.

From the Azure Portal, navigate to your CosmosDB Account

  1. Select Logs from the Monitoring blade

  2. Select CDBPartitionKeyStatistics and run the query to list PartitionKey sizes collected at regular intervals by the platform.

138049-image.png


You can choose to narrow down the search criteria here if you are interested in alerting on specific partition keys or collections using queries

 CDBPartitionKeyStatistics  | where CollectionName == "YourCollectionName"

Select New Alert Rule, specify the Criteria and Alert logic

138086-image.png

When threshold crosses 18GB

138102-image.png

And select/create an appropriate Action Group in the next step to alert yourself/your dev team via email.

Please let us know if you have any further questions.


If an answer is helpful, please click on 130616-image.png or upvote 130671-image.png which might help other community members reading this thread.



image.png (133.2 KiB)
image.png (41.0 KiB)
image.png (8.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.