Cloudwatch - The In's and Out's

3,821 views

Published on

Published in: Technology
1 Comment
4 Likes
Statistics
Notes
No Downloads
Views
Total views
3,821
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
143
Comments
1
Likes
4
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Cloudwatch - The In's and Out's

    1. 1. CloudWatch the In’s and Out’sAWS-DC 2012-01-25
    2. 2. What is CloudWatch?
    3. 3. At its most basic -AWS instrumentation
    4. 4. Every AWS Service has “Metrics”: • ELB Front- and Back-end Response Codes • ElastiCache hits and misses • EBS IOPS • SQS Queue Length
    5. 5. Can even combine them
    6. 6. Every Metric can be converted into an Alarm
    7. 7. Alarms can take actions:• Send message through SNS• Trigger autoscaling
    8. 8. Even Better You can create your own metricsSo you can trigger your own events
    9. 9. TerminologyMetric - a time-ordered set of data pointsDimension - A name/value pair that helps you touniquely identify a metric.  e.g.:  EC2 InstanceIDNameSpace - containerStatistic Set - Aggregated set of data points (asoften as once per minute)
    10. 10. Example from the AWS tutorial: Pick an arbitrary set of data points• Hour one: 87, 51, 125, 235• Hour two: 121, 113, 189, 65, 89• Hour three: 100, 47, 133, 98, 100, 328
    11. 11. Hour 1 - Individual points Hour Raw Data 1 87 1 51 1 125 1 235
    12. 12. Hours 2&3 - Stat Sets Four predefined keys:  Sum, Minimum, Maximum, and SampleCount SampleHour Raw Data Sum Min Max Count 2 121,113,189,65,89 577 65 189 5 3 100,47,133,98,100,328 806 47 328 6
    13. 13. Push with CLI# For Hour 1# The unit of measurement is optionalmon-put-data -m RequestLatency -n "Nathan" -t 2012-01-24T11:00:00 -v 87 -u Millisecondsmon-put-data -m RequestLatency -n "Nathan" -t 2012-01-24T11:00:00 -v 51 -u Millisecondsmon-put-data -m RequestLatency -n "Nathan" -t 2012-01-24T11:00:00 -v 125 -u Millisecondsmon-put-data -m RequestLatency -n "Nathan" -t 2012-01-24T11:00:00 -v 235 -u Milliseconds# For Hour 2mon-put-data -m RequestLatency -n "Nathan" -t 2012-01-24T12:00:00 -s "Sum=577,Minimum=47,Maximum=189,SampleCount=5" -u Milliseconds# For Hour 3# If no timestamp is provided, it defaults to the current timemon-put-data -m RequestLatency -n "Nathan" -s "Sum=806,Minimum=47,Maximum=328,SampleCount=6" -u Milliseconds
    14. 14. When you use the mon-put-data command, you must use adate range within the past two weeks. There is currently nofunction to delete data points. Amazon CloudWatchautomatically deletes data points with a timestamp more thantwo weeks old.Can include --dimensions "x=y,u=v" in both puts and gets
    15. 15. Retrieve Stats with CLIMacBook-Pro:~ user$ mon-get-stats -n Nathan -m RequestLatency -s "Average" --start-time 2012-01-24T11:00:00 --period 3600 --headersTime Average Unit2012-01-24 11:00:00 106.0 Milliseconds2012-01-24 12:00:00 122.5 Milliseconds
    16. 16. View Online
    17. 17. Quirks of the ViewOne drawback to CloudWatch is that can be difficult to understand the graphs
    18. 18. It’ll report what you ask for - Literally E.g. If you leave "Sum" selected and select "Healthy Host Count", it adds up all the data points supplied during the period selected. So instead of "10" you get "2500".
    19. 19. In this case youd want min, max or avg.
    20. 20. Have to experiment with different view parameters to get an accurate picture E.g.:  ELB Response Codes - the data points dont represent numbers of coded responses during aperiod.  Each one represents one instance of a code received.  So to see the number of 2xx response codes for a period, you need to select the "Sum" statistic
    21. 21. If there arent enough data-points, it wont draw the connecting lines.
    22. 22. Amazon CloudWatch does not aggregate data across Regions List of available endpoints and regions:   http://docs.amazonwebservices.com/general/latest/gr/rande.html?r=5025
    23. 23. Bottom line:Create information out of your system statistics and then act on it - automatically
    24. 24. Docs and ToolsDocumentation: http://aws.amazon.com/documentation/cloudwatch/CloudWatch CLI tools:Setup Page: http://docs.amazonwebservices.com/AmazonCloudWatch/latest/GettingStartedGuide/SetupCLI.htmlSet JAVA_HOME on OSX Lion: http://steveswinsburg.wordpress.com/2011/07/22/java_home-on-os-x-lion/Reference for AWS Service Metrics http://docs.amazonwebservices.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.htmlGreat How-To with Python and Boto: http://loggly.com/blog/2011/05/send-custom-metrics-to-cloudwatchs-api/
    25. 25. Contact Info Nathan McCourtney @beaknit gmail: beaknit

    ×