Unverified Commit 8e3c57a1 by Feanil Patel Committed by GitHub

Merge pull request #4399 from edx/feanil/update_metrics_script

Make it so we update alarms even when they already exist.
parents e81a31fa 835a518e
......@@ -143,11 +143,8 @@ def check_queues(host, port, environment, deploy, max_metrics, threshold,
alarm_name = "{}-{} {} queue length over threshold".format(environment,
deploy,
queue)
if len(cloudwatch.describe_alarms_for_metric(Namespace=namespace,
MetricName=metric_name,
Dimensions=dimensions)
['MetricAlarms']) < 1:
print('Creating new alarm "{}"'.format(alarm_name))
print('Creating or updating alarm "{}"'.format(alarm_name))
cloudwatch.put_metric_alarm(AlarmName=alarm_name,
AlarmDescription=alarm_name,
Namespace=namespace,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment