CloudWatch custom metrics



Page Navigation:

Page Navigation:

 

 


Confidence Level TBD  This article has not been reviewed for accuracy, timeliness, or completeness. Check that this information is valid before acting on it.

Confidence Level TBD  This article has not been reviewed for accuracy, timeliness, or completeness. Check that this information is valid before acting on it.

 

Introduction

When we use Amazon Web Services autoscaling, we need to configure an alarm that is triggered when a certain condition is met.  Usually, this involves checking whether a CloudWatch metric falls within or outside a certain range. 

 

Since we want to trigger autoscaling when we have a large number of jobs in the system, Mozart needs to communicate this metric to Amazon, so it can be used in CloudWatch.   We can define custom metrics.   This is done via https://github.jpl.nasa.gov/hysds-org/hysds/blob/master/scripts/sync_ec2_job_metric.py

The program runs in  supervisord on Mozart.  This is not enabled by default, because it is customized based on which queues are being monitored.   You need to add a new program block for each queue you are monitoring.



This is the templated version kept in GitHub for ARIA Ops:

hysds_cluster_fab/files/supervisord.conf.mozart


Code

[program:sync_ec2_job_metric-{{ MONITORED_QUEUE_5 }}]

directory=/home/ops/mozart/ops/hysds/scripts

command=/home/ops/mozart/ops/hysds/scripts/sync_ec2_job_metric.py --interval 60 {{ MONITORED_QUEUE_5 }}

process_name=%(program_name)s

priority=1

numprocs=1

numprocs_start=0

redirect_stderr=true

stdout_logfile=%(here)s/../log/%(program_name)s.log

startsecs=10





MONITORED_QUEUE_5 is a template variable defined in hysds_cluster_fab/context.sh



export MONITORED_QUEUE=spyddder-extract





Once Fabric pushes the configuration to Mozart, it can be found on Mozart at:  /home/ops/mozart/etc/supervisord.conf



[program:sync_ec2_job_metric-spyddder-extract]

directory=/home/ops/mozart/ops/hysds/scripts

command=/home/ops/mozart/ops/hysds/scripts/sync_ec2_job_metric.py --interval 60 spyddder-extract

process_name=%(program_name)s

priority=1

numprocs=1

numprocs_start=0

redirect_stderr=true

stdout_logfile=%(here)s/../log/%(program_name)s.log

startsecs=10




Related Articles:

Related Articles:

Have Questions? Ask a HySDS Developer:

Anyone can join our public Slack channel to learn more about HySDS. JPL employees can join #HySDS-Community

JPLers can also ask HySDS questions at Stack Overflow Enterprise

Page Information:

Page Information:

Was this page useful?

Yes No

Contribution History:

Subject Matter Expert:

@Gerald Manipon

@Hook Hua

@Lan Dang

Find an Error?

Is this document outdated or inaccurate? Please contact the assigned Page Maintainer:

@Lan Dang

Note: JPL employees can also get answers to HySDS questions at Stack Overflow Enterprise: