To retrieve and filter recommended monitors in an elegant way, so we won't need to update our own map when we add a new recommended monitor.
Testing Guidelines
Testing Guidelines
Automated Testing
Passed the added test and existing tests.
Manual Testing
Steps:
Update a stack with all the 7 recommended monitors. The stack had monitors high_error_rate, timeout, high_cold_start_rate, high_throttles before the update.
Background
Right now we are using a hard-coded map to identify the recommended monitor given its serverless_id like
high_error_rate
:This is a temporary remediation for issue: https://github.com/DataDog/serverless-plugin-datadog/issues/545 and incident 31902.
What does this PR do?
Use the tag from the Recommended Monitor API response to identify the monitor.
The response is like:
See full API response here: https://app.datadoghq.com/api/v2/monitor/recommended?count=50&start=0&search=tag%3A%22product%3Aserverless%22%20AND%20tag%3A%22integration%3Aamazon-lambda%22
Motivation
To retrieve and filter recommended monitors in an elegant way, so we won't need to update our own map when we add a new recommended monitor.
Testing Guidelines
Testing Guidelines
Automated Testing
Passed the added test and existing tests.
Manual Testing
Steps:
high_error_rate
,timeout
,high_cold_start_rate
,high_throttles
before the update.serverless deploy
Result:
All the 7 monitors have been updated or created. They all appear in Datadog App.
Additional Notes
Types of changes
Check all that apply