CloudWatch Metrics
A cloudwatch metrics:
- Represents a time-ordered set of data points published to CloudWatch.
- It is similar to a variable to monitor, with data points as values of that variable over time.
- data points can come from any application in AWS
- AWS services send metrics to CloudWatch
- Can send custom metrics to CloudWatch also
- Can add data points in any order or at any rate
- Retrieve statistics about data points as an ordered set of time-series data.
- Metrics are specific to a Region of creation
- Metrics cannot be deleted,
- Automatically expire after 15 months if no new data published to them.
- They expire on a rolling basis; as new data points come in, data older than 15 months drops.
- 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.
CloudWatch Metrics Time Stamps
- Each metric data point must link with a time stamp.
- The time stamp can be up to two weeks in the past
- up to two hours into the future.
- If no time stamp is given, CloudWatch creates a time stamp on time data point receive.
- Time stamps are dateTime objects
- Coordinated Universal Time (UTC) is recommended
- When you retrieve statistics from CloudWatch, all times are in UTC
- CloudWatch alarms check metrics based on the current time in UTC.
CloudWatch Metrics Retention
This retains metric data as follows:
- Data points with a period of less than 60 seconds are available for 3 hours. Also called as high-resolution custom metrics.
- Data points with a period of 60 seconds (1 minute) are available for 15 days
- And, 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)
CloudWatch Metrics Units
- Each statistic has a unit of measure.
- Example units – Bytes, Seconds, Count, and Percent.
- Can specify a unit when you create a custom metric.
- If not specified, CloudWatch uses None as the unit.
- CloudWatch attaches no significance to a unit internally
- Metric data points that specify a unit of measure aggregates separately.
- Statistics without specifying a unit, CloudWatch aggregates all data points of the same unit together.
CloudWatch Metrics Periods
- Period is the length of time associate with a specific Amazon CloudWatch statistic.
- Periods defined in seconds, and valid values for period are 1, 5, 10, 30, or any multiple of 60.
- For period of six minutes, use 360 as the period value.
- Can adjust how the data aggregates by varying the length of the period.
- Only custom metrics that you define with a storage resolution of 1 second support sub-minute periods.
- To retrieve statistics, specify a period, start time, and end time.
- The default values for the start time and end time get you the last hour’s worth of statistics.
- For statistics aggregated over the entire hour, specify a period of 3600.
- aggregated statistics are stamped with the time corresponding to the beginning of the period.
- Periods are also important for CloudWatch alarms.
CloudWatch Metrics Aggregation
- CloudWatch aggregates statistics as per specified period length
- publish as many data points as needed with same or similar time stamps.
- CloudWatch aggregates them as per specified period length.
- CloudWatch does not aggregate data across Regions.
- For large datasets, insert a pre-aggregated dataset called a statistic set.
- With statistic sets, gives Min, Max, Sum, and SampleCount for a number of data points.
- CloudWatch doesn’t differentiate the source of a metric.
- Treated as single metric, even if metric is published with same namespace and dimensions from different sources
CloudWatch Percentiles
- A percentile indicates the relative standing of a value in a dataset.
- example, the 95th percentile means that 95 percent of the data is lower than this value and 5 percent of the data is higher than this value.
- Used to isolate anomalies.
AWS Certified DevOps Engineer Free Practice TestTake a Quiz