- Newest
- Most votes
- Most comments
Likely you'd need "deployment system" to publish a metric DeploymentInProgress with value 1 for each minute there is a deployment. That would allow you to have an alarm called DeploymentInProgress that triggers on seeing a 1 and stays in alarm while seeing a 1.
The magic ingredient is that metric with value 1, not sure how you would get that, depends on what deployment system you have. One way that can help is writing a Lambda function that is triggered every minute by an EventBridge scheduled rule and that Lambda could query "deployment system" and log the metric you need (EMF is best way to log metric in Lambda).
Hi, there are many ways you could implement a DeploymentInProgress alarm, here are a few suggestions:
- Use a dummy alarm that is always true or always false, and update it at the start and at the end of your deployment. See below an example called "AlwaysFalse" - by simply updating the threshold you can force the alarm to flip to either always true or always false within the next minute
- If your deployment is set at a regular cadence, use metric math to create a pseudo-metric that represents the time window of your deployment.
- If the script or pipeline that controls your deployment exposes an API or endpoint that you can use to detect whether a deployment is in progress or not, you could use multi-datasource querying to scrape the API or endpoint status and return it as a metric to alarm on
Example of AlwaysFalse alarm for tip 1: aws cloudwatch put-metric-alarm --alarm-name "AlwaysFalse" --actions-enabled --evaluation-periods 1 --datapoints-to-alarm 1 --threshold 1 --comparison-operator GreaterThanThreshold --metrics "[{"Id":"e1","Label":"Expression1","ReturnData":true,"Expression":"TIME_SERIES(2)","Period":300}]"
Relevant content
- asked a year ago
- How can I monitor daily EstimatedCharges and trigger a CloudWatch alarm based on my usage threshold?AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 15 days ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 8 months ago