In this, we will learn the concepts of Auto Scaling Monitoring.

Auto Scaling can monitor instances and groups by

  • Health checks –
    • EC2 Auto Scaling periodically performs health checks on instances in the Auto Scaling group
    • It identifies unhealthy instances
    • Auto Scaling Monitoring finds health status using EC2 status checks, ELB health checks, or custom health checks.
  • CloudWatch metrics
    • EC2 Auto Scaling publishes data points to Amazon CloudWatch
    • CloudWatch retrieve statistics about those data points as ordered set of time series data or metrics.
    • use these metrics to verify that system is working as expected.
  • CloudWatch Events
    • EC2 Auto Scaling can also submit events to CloudWatch Events
    • Event submission is when
    • Auto Scaling groups launch or terminate instances,
    • lifecycle action occurs.
    • Can invoke Lambda function when the event occurs.
  • SNS notifications
    • EC2 Auto Scaling can send Amazon SNS notifications
    • SNS sent, when groups launch or terminate instances.
  • CloudTrail logs
    • CloudTrail tracks calls to EC2 Auto Scaling API by
    • It stores the information in log files in S3 bucket
    • Use log files to monitor activity of your Auto Scaling groups.
    • Logs include
      • which requests were made,
      • source IP addresses of requests
      • who made the request
      • when the request was made
Instance Health Status

EC2 Auto Scaling finds health status of an instance using one or more of the following:

  • Status checks by EC2 and includes both instance and system status checks.
    • Health checks provided by Elastic Load Balancing.
    • custom health checks.
  • Instance is considered unhealthy in any state other than running or if system status is impaired,
  • unhealthy instance is terminated and replacement is launched
  • Following states makes instance unhealthy
    • stopping
    • stopped
    • terminating
    • terminated

Auto Scaling Group Metrics

The AWS/AutoScaling namespace includes the following metrics.

MetricDescription
GroupMinSizeThe minimum size of the Auto Scaling group.
GroupMaxSizeThe maximum size of the Auto Scaling group.
GroupDesiredCapacityThe number of instances that the Auto Scaling group attempts to maintain.
GroupInServiceInstancesThe number of instances that are running as part of the Auto Scaling group. This metric does not include instances that are pending or terminating.
GroupPendingInstancesThe number of instances that are pending. A pending instance is not yet in service. This metric does not include instances that are in service or terminating.
GroupStandbyInstancesThe number of instances that are in a Standby state. Instances in this state are still running but are not actively in service.
GroupTerminatingInstancesThe number of instances that are in the process of terminating. This metric does not include instances that are in service or pending.
GroupTotalInstancesThe total number of instances in the Auto Scaling group. This metric identifies the number of instances that are in service, pending, and terminating.
CloudWatch Events
  • It can automate AWS services and respond to system events as
    • application availability issues
    • resource changes
  • Events from AWS services are delivered to CloudWatch Events in real time.
  • Define rules to indicate actions to perform, against events
  • EC2 Auto Scaling can send events to CloudWatch Events for events
    • EC2 Instance-launch Lifecycle Action
    • EC2 Instance Launch Successful
    • EC2 Instance Launch Unsuccessful
    • EC2 Instance-terminate Lifecycle Action
    • EC2 Instance Terminate Successful
    • EC2 Instance Terminate Unsuccessful
SNS Notifications

EC2 Auto Scaling can send SNS notifications against following events

EventDescription
autoscaling:EC2_INSTANCE_LAUNCHSuccessful instance launch
autoscaling:EC2_INSTANCE_LAUNCH_ERRORFailed instance launch
autoscaling:EC2_INSTANCE_TERMINATESuccessful instance termination
autoscaling:EC2_INSTANCE_TERMINATE_ERRORFailed instance termination

The message includes the following information:

  • Event — The event.
  • AccountId — The AWS account ID.
  • AutoScalingGroupName — The name of the Auto Scaling group.
  • AutoScalingGroupARN — The ARN of the Auto Scaling group.
  • EC2InstanceId — The ID of the EC2 instance.

Check here for more.

Menu