AWS Auto Scaling

Overview

AWS Auto Scaling is a service to launch or terminate EC2 instances automatically based on user-defined policies.

Enable this integration to see all your Auto Scaling metrics in Datadog.

  • Collect EC2 metrics for hosts in Auto Scaling groups with the autoscaling_group tag.
  • Collect Auto Scaling metrics about the specific group with the autoscaling_group and autoscalinggroupname tags.

Setup

Installation

If you haven’t already, set up the Amazon Web Services integration first.

Metric collection

  1. In the Datadog AWS integration page, ensure that AutoScaling is enabled under the Metric Collection tab.

  2. In AWS, Auto Scaling data must be sent to CloudWatch. See Enable Auto Scaling Group Metrics.

  3. Add the following permissions to your Datadog IAM policy in order to collect AWS Auto Scaling metrics. For more information, see the Auto Scaling policies on the AWS website.

    AWS PermissionDescription
    autoscaling:DescribeAutoScalingGroupsUsed to list all Auto Scaling groups.
    autoscaling:DescribePoliciesList available policies (for autocompletion in events and monitors).
    autoscaling:DescribeTagsUsed to list tags for a given Auto Scaling group. This adds ASG custom tags on ASG CloudWatch metrics.
    autoscaling:DescribeScalingActivitiesUsed to generate events when an ASG scales up or down.
    autoscaling:ExecutePolicyExecute one policy (scale up or down from a monitor or the events feed).
    This is not included in the installation Policy Document and should only be included if you are using monitors or events to execute an Auto Scaling policy.
  4. Install the Datadog - AWS Auto Scaling integration.

Log collection

Enable logging

Configure AWS Auto Scaling to send logs either to a S3 bucket or to CloudWatch.

Note: If you log to a S3 bucket, make sure that amazon_auto_scaling is set as Target prefix.

Send logs to Datadog

  1. If you haven’t already, set up the Datadog Forwarder Lambda function.

  2. Once the Lambda function is installed, manually add a trigger on the S3 bucket or CloudWatch log group that contains your AWS Auto Scaling logs in the AWS console:

Data Collected

Metrics

aws.autoscaling.group_desired_capacity
(gauge)
The number of instances that the Auto Scaling group attempts to maintain.
aws.autoscaling.group_in_service_instances
(gauge)
The number of instances that are running as part of the Auto Scaling group. This metric does not include instances that are pending or terminating.
aws.autoscaling.group_max_size
(gauge)
The maximum size of the Auto Scaling group.
aws.autoscaling.group_min_size
(gauge)
The minimum size of the Auto Scaling group.
aws.autoscaling.group_pending_instances
(gauge)
The 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.
aws.autoscaling.group_terminating_instances
(gauge)
The number of instances that are in the process of terminating. This metric does not include instances that are in service or pending.
aws.autoscaling.group_total_instances
(gauge)
The total number of instances in the Auto Scaling group. This metric identifies the number of instances that are in service and/or pending and/or terminating.

Each of the metrics retrieved from AWS is assigned the same tags that appear in the AWS console, including but not limited to host name, security-groups, and more.

Events

The AWS Auto-Scaling integration includes events for launching and terminating EC2 instances. See example events below:

AWS Auto-Scaling Events

Service Checks

The AWS Auto-Scaling integration does not include any service checks.

Troubleshooting

In order for the ASG metrics to start appearing in Datadog, first enable them in your AWS console. See the AWS instructions on how to enable your ASG metrics. Note: It may take a while for such metrics to appear after they have been enabled.

Need help? Contact Datadog support.

PREVIEWING: may/unit-testing