You are configuring a monitoring solution for an Azure Cosmos DB API for NoSQL account. You need to configure an Azure Monitor alert rule that triggers when client applications receive HTTP status code 429 (Request Rate Too Large) responses. When triggered, the alert must email the operations team and execute an Azure Automation runbook. Which of the following configurations should you implement?
- ACreate a log search alert rule that runs a KQL query against the AzureDiagnostics table to count requests where the Status_s column equals '429', but omit any time-range filter (such as TimeGenerated > ago(5m)) from the query text, relying entirely on the alert rule's query frequency setting.
- BConfigure the Application Insights SDK in the client application code to track dependency failures with status code 429, set up a metric alert in Application Insights, and do not define the Application Insights connection string in the application settings.
- Create a metric alert rule for the Cosmos DB resource targeting the 'Total Requests' metric, add a dimension filter where 'StatusCode' equals '429', and associate the rule with an action group containing Email and Automation Runbook actions.Answer
- DConfigure an autoscale rule for the Cosmos DB account that monitors the throughput metric, sets a scale-out threshold to trigger the Automation runbook, and defines a scale-in threshold that is higher than the scale-out threshold.
Answer
Create a metric alert rule for the Cosmos DB resource targeting the 'Total Requests' metric, add a dimension filter where 'StatusCode' equals '429', and associate the rule with an action group containing Email and Automation Runbook actions.
The correct configuration is to create a metric alert rule targeting the 'Total Requests' metric on the Azure Cosmos DB resource, filter it using the 'StatusCode' dimension set to '429', and trigger an action group containing both Email and Automation Runbook actions. This utilizes native Azure Monitor capabilities to detect rate limiting and execute both notification and remediation steps efficiently.
Step-by-Step Solution
Key Concept
Azure Monitor Metric Alerts with dimension filters and Action Groups with multiple receivers