Question

I am new to AWS AutoScaling and CloudWatch, and am using both these sdks on the windows command line. Either what I am trying to do is not possible, there is information missing from the tutorial, OR I am having a complete understanding disconnect. Help me figure out which one, please.

I have successfully set up a launch config, autoscaler, policies, and alarms relating to those policies using AWS. However, through all of the tutorials I have gone through, and examples on the web, I am have yet to see how to actually specify exactly which queue that I want my alarms to be monitoring the metrics of.

Suppose that I have several queues in the Amazon Cloud. How do I specify setting autoscaling and alarms on one of my queues and not others?

I followed these tutorials:

  1. http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US_BasicSetup.html
  2. Creating Policies and Alarms section in http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html
Was it helpful?

Solution

ok. Short answer is that you need to add to the --dimensions parameter.

--dimensions="QueueName=TheNameOftheQueue"

Long answer, the documentation is only partially there on their site. Assuming you use this as a starting point: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-using-sqs-queue.html , You get to the line where you are having trouble which is:

prompt>mon-put-metric-alarm --alarm-name AddCapacityToProcessQueue  --metric-name ApproximateNumberOfMessagesVisible --namespace “AWS/SQS” --statistic Average --period 60 --threshold 3 --comparison-operator GreaterThanOrEqualToThreshold --dimensions “AutoScalingGroupName=my-test-asg” --evaluation-periods 2 --alarm-actions arn:aws:autoscaling:us-east-1:803981987763:scalingPolicy:f4390e81-9a48-4655-ba57-f059d17799ea:autoScalingGroupName/my-test-asg:policyName/my-sqs-scaleout-policy

The issue being that the dimensions aren't fully filled out in their example:

--dimensions “AutoScalingGroupName=my-test-asg”

To know which dimensions this particular type of alarm might have, and that would be useful...you'd go here: http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#Dimension , But...of course that only has listings for:

Dimensions for Amazon EC2 Metrics

Dimensions for Elastic Load Balancing Metrics

Dimensions for RDS Metrics

This thread, https://forums.aws.amazon.com/thread.jspa?threadID=72613 , answers the question eventually/at the end. (And the answer is in json format, so you have to translate to command line syntax). ie. --dimensions="keyname=keyvalue,keyname=keyvalue".

Hope this helps. :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top