70. Amazon CloudWatch

Overview

  • Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the applications you run on AWS in real time.
  • You can use CloudWatch to collect and track metrics, which are variables you can measure for your resources and applications.
  • The CloudWatch home page automatically displays metrics about every AWS service you use. You can additionally create custom dashboards to display metrics about your custom applications, and display custom collections of metrics that you choose.
  • You can create alarms that watch metrics and send notifications or automatically make changes to the resources you are monitoring when a threshold is breached.
  • With CloudWatch, you gain system-wide visibility into resource utilization, application performance, and operational health

​​​​​​​How Amazon CloudWatch works

  • Amazon CloudWatch is basically a metrics repository.
  • An AWS service—such as Amazon EC2—puts metrics into the repository, and you retrieve statistics based on those metrics.
  • If you put your own custom metrics into the repository, you can retrieve statistics on these metrics as well.
  • Metrics are stored separately in Regions, but you can use CloudWatch cross-Region functionality to aggregate statistics from different Regions

Amazon CloudWatch concepts

  • Namespaces
    • namespace is a container for CloudWatch metrics.
    • Metrics in different namespaces are isolated from each other, so that metrics from different applications are not mistakenly aggregated into the same statistics.
    • There is no default namespace. You must specify a namespace for each data point you publish to CloudWatch.
  • Metrics
    • Metrics are the fundamental concept in CloudWatch.
    • A metric represents a time-ordered set of data points that are published to CloudWatch.
    • Think of a metric as a variable to monitor, and the data points as representing the values of that variable over time.
    • Metrics exist only in the Region in which they are created.
    • Metrics cannot be deleted, but they automatically expire after 15 months if no new data is published to them.
    • Metrics are uniquely defined by a name, a namespace, and zero or more dimensions. Each data point in a metric has a time stamp, and (optionally) a unit of measure.
  • Time stamps

    • Each metric data point must be associated with a time stamp.
    • The time stamp can be up to two weeks in the past and up to two hours into the future.
    • If you do not provide a time stamp, CloudWatch creates a time stamp for you based on the time the data point was received.
  • Metrics retention
    • Data points with a period of less than 60 seconds are available for 3 hours. These data points are high-resolution custom metrics.
    • Data points with a period of 60 seconds (1 minute) are available for 15 days
    • Data points with a period of 300 seconds (5 minute) are available for 63 days
    • Data points with a period of 3600 seconds (1 hour) are available for 455 days (15 months)
    • Data points that are initially published with a shorter period are aggregated together for long-term storage. For example, if you collect data using a period of 1 minute, the data remains available for 15 days with 1-minute resolution. After 15 days this data is still available, but is aggregated and is retrievable only with a resolution of 5 minutes. After 63 days, the data is further aggregated and is available with a resolution of 1 hour.
  • Dimensions
    • dimension is a name/value pair that is part of the identity of a metric.
    • You can assign up to 10 dimensions to a metric.
    • AWS services that send data to CloudWatch attach dimensions to each metric. You can use dimensions to filter the results that CloudWatch returns. For example, you can get statistics for a specific EC2 instance by specifying the InstanceId dimension when you search for metrics.
    • For metrics produced by certain AWS services, such as Amazon EC2, CloudWatch can aggregate data across dimensions
  • Dimension combinations
    • CloudWatch treats each unique combination of dimensions as a separate metric, even if the metrics have the same metric name.
    • You can only retrieve statistics using combinations of dimensions that you specifically published.
    • When you retrieve statistics, specify the same values for the namespace, metric name, and dimension parameters that were used when the metrics were created.
    • You can also specify the start and end times for CloudWatch to use for aggregation.
  • Resolution
    • Each metric is one of the following:
      • Standard resolution, with data having a one-minute granularity
      • High resolution, with data at a granularity of one second
    • Metrics produced by AWS services are standard resolution by default. When you publish a custom metric, you can define it as either standard resolution or high resolution.
  • Statistics
    • Statistics are metric data aggregations over specified periods of time. 
    • Aggregations are made using the namespace, metric name, dimensions, and the data point unit of measure, within the time period you specify.
  • Units
    • Each statistic has a unit of measure.
    • Example units include BytesSecondsCount, and Percent.
  • Periods
    • period is the length of time associated with a specific Amazon CloudWatch statistic. 
    • Each statistic represents an aggregation of the metrics data collected for a specified period of time.
    • Periods are defined in numbers of seconds, and valid values for period are 1, 5, 10, 30, or any multiple of 60. 
    • When you retrieve statistics, you can specify a period, start time, and end time
  • Aggregation
    • Amazon CloudWatch aggregates statistics according to the period length that you specify when retrieving statistics.
    • You can publish as many data points as you want with the same or similar time stamps.
    • CloudWatch aggregates them according to the specified period length.
    • CloudWatch does not automatically aggregate data across Regions, but you can use metric math to aggregate metrics from different Regions.
  • Alarms
    • You can use an alarm to automatically initiate actions on your behalf.
    • An alarm watches a single metric over a specified time period, and performs one or more specified actions, based on the value of the metric relative to a threshold over time.
    • The action is a notification sent to an Amazon SNS topic or an Auto Scaling policy

​​​​​​​​​​​​​​Reference

What is Amazon CloudWatch? - Amazon CloudWatch

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值