The Service Map for APM is here!

Elastic Beanstalk

Crawler Crawler

Overview

AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker on familiar servers such as Apache, Nginx, Passenger, and IIS.

Setup

Installation

If needed, set up the Amazon Web Services integration first.

To receive Elastic Beanstalk metrics, you must enable the Enhanced Health Reporting feature for your environment, and configure your environment to publish enhanced health metrics to CloudWatch.

Note: These settings increase your CloudWatch custom metric charges.

Datadog Container Agent Configuration

If you use Docker containers in your Elastic Beanstalk environment, use the containerized Datadog Agent to monitor Docker usage. Follow the steps below to configure your environment to integrate the Datadog Agent container.

Task definition

To run docker environments with multiple containers per instance, Elastic Beanstalk relies on Amazon EC2 Container Service (ECS). For this reason you need to describe the containers you want to deploy the ECS-way. In Elastic Beanstalk this is configured using a file named Dockerrun.aws.json.

A Dockerrun.aws.json file is an Elastic Beanstalk–specific JSON file that describes how to deploy a set of Docker containers as an Elastic Beanstalk application. You can use this file for a multicontainer Docker environment.

Dockerrun.aws.json describes the containers to deploy to each container instance in the environment and the data volumes to create on the host instance for the containers to mount.

A Dockerrun.aws.json file can be used on its own or zipped up with additional source code in a single archive. Source code that is archived with Dockerrun.aws.json is deployed to container instances and accessible in the /var/app/current/ directory. Use the volumes section of the config to provide mount points for the containers running on the instance and the mountPoints section of the embedded container definitions to mount them from the containers.

The following code sample illustrates a Dockerrun.aws.json declaring the Datadog Agent. Update the containerDefinitions section with your Datadog API Key, tags, and any additional container definitions. If needed, this file can be zipped with additional content as described above. For more info about the syntax of this file you can refer to the Beanstalk documentation.

{
  "AWSEBDockerrunVersion": 2,
  "volumes": [
    {
       "name": "docker_sock",
       "host": {
            "sourcePath": "/var/run/docker.sock"
      }
    },
    {
       "name": "proc",
       "host": {
            "sourcePath": "/proc/"
      }
    },
    {
       "name": "cgroup",
       "host": {
            "sourcePath": "/cgroup/"
      }
    }
  ],
  "containerDefinitions": [
    {
      "name": "dd-agent",
      "image": "datadog/agent:latest",
      "environment": [
            {
              "name": "DD_API_KEY",
              "value": "<YOUR_DD_API_KEY>"
            },
            {
              "name": "TAGS",
              "value": "<SIMPLE_TAG>, <KEY:VALUE_TAG>"
            }
      ],
      "memory": 256,
      "mountPoints": [
        {
          "sourceVolume": "docker_sock",
          "containerPath": "/var/run/docker.sock",
          "readOnly": false
        },
        {
          "sourceVolume": "proc",
          "containerPath": "/host/proc",
          "readOnly": true
        },
        {
          "sourceVolume": "cgroup",
          "containerPath": "/host/sys/fs/cgroup",
          "readOnly": true
        }
      ]
    }
  ]
}

Creating the environment

Once the container definition is ready, ship it to Elastic Beanstalk. For specific instructions, refer to Multicontainer Docker Environments in the AWS Elastic Beanstalk documentation.

Alternate Datadog Agent Configuration

Follow these steps to install the Datadog Agent in Elastic Beanstalk using Advanced Environment Customization with Configuration Files (.ebextensions).

  1. Create a folder named .ebextensions in the root of your application source bundle.
  2. Download 99datadog.config to .ebextensions.
  3. Under option_settings, update the config with your Datadog API Key.
  4. Deploy your application with the Elastic Beanstalk Console, EB CLI, or AWS CLI.

Additional Settings

Add more settings to datadog.yaml by updating the "/configure_datadog_yaml.sh" section of 99datadog.config. The line below enables the Datadog Process Agent.

echo -e "process_config:\n  enabled: \"true\"\n" >> /etc/datadog-agent/datadog.yaml

Data Collected

Metrics

aws.elasticbeanstalk.application_latency_p_1_0
(gauge)
The average time to complete the fastest 10 percent of requests.
shown as second
aws.elasticbeanstalk.application_latency_p_5_0
(gauge)
The average time to complete the fastest 50 percent of requests.
shown as second
aws.elasticbeanstalk.application_latency_p_7_5
(gauge)
The average time to complete the fastest 75 percent of requests.
shown as second
aws.elasticbeanstalk.application_latency_p_8_5
(gauge)
The average time to complete the fastest 85 percent of requests.
shown as second
aws.elasticbeanstalk.application_latency_p_9_0
(gauge)
The average time to complete the fastest 90 percent of requests.
shown as second
aws.elasticbeanstalk.application_latency_p_9_5
(gauge)
The average time to complete the fastest 95 percent of requests.
shown as second
aws.elasticbeanstalk.application_latency_p_9_9
(gauge)
The average time to complete the fastest 99 percent of requests.
shown as second
aws.elasticbeanstalk.application_latency_p_9_9_9
(gauge)
The average time to complete the fastest 99.9 percent of requests.
shown as second
aws.elasticbeanstalk.application_requests_2xx
(count)
The number of requests that completed with a 2XX status code.
shown as request
aws.elasticbeanstalk.application_requests_3xx
(count)
The number of requests that completed with a 3XX status code.
shown as request
aws.elasticbeanstalk.application_requests_4xx
(count)
The number of requests that completed with a 4XX status code.
shown as request
aws.elasticbeanstalk.application_requests_5xx
(count)
The number of requests that completed with a 5XX status code.
shown as request
aws.elasticbeanstalk.application_requests_total
(count)
The number of requests completed by the instance or environment.
shown as request
aws.elasticbeanstalk.cpuidle
(gauge)
[Instance] The percentage of time the CPU was in the idle state in the last minute.
shown as percent
aws.elasticbeanstalk.cpuiowait
(gauge)
[Instance] The percentage of time the CPU was in the iowait state in the last minute.
shown as percent
aws.elasticbeanstalk.cpuirq
(gauge)
[Instance] The percentage of time the CPU was in the interrupt request state in the last minute.
shown as percent
aws.elasticbeanstalk.cpunice
(gauge)
[Instance] The percentage of time the CPU was in the nice state in the last minute.
shown as percent
aws.elasticbeanstalk.cpusoftirq
(gauge)
[Instance] The percentage of time the CPU was in the soft interrupt request state in the last minute.
shown as percent
aws.elasticbeanstalk.cpusystem
(gauge)
[Instance] The percentage of time the CPU was in the system state in the last minute.
shown as percent
aws.elasticbeanstalk.cpuuser
(gauge)
[Instance] The percentage of time the CPU was in the user state in the last minute.
shown as percent
aws.elasticbeanstalk.environment_health
(gauge)
[Environment] The health status of the environment. The possible values are 0 (OK) 1 (Info) 5 (Unknown) 10 (No data) 15 (Warning) 20 (Degraded) and 25 (Severe).
aws.elasticbeanstalk.instance_health
(gauge)
[Instance] The health status of the instance.
shown as instance
aws.elasticbeanstalk.instances_degraded
(count)
[Environment] The number of instances with Degraded health status.
shown as instance
aws.elasticbeanstalk.instances_info
(count)
[Environment] The number of instances with Info health status.
shown as instance
aws.elasticbeanstalk.instances_no_data
(count)
[Environment] The number of instances with no health status data.
shown as instance
aws.elasticbeanstalk.instances_ok
(count)
[Environment] The number of instances with OK health status.
shown as instance
aws.elasticbeanstalk.instances_pending
(count)
[Environment] The number of instances with Pending health status.
shown as instance
aws.elasticbeanstalk.instances_severe
(count)
[Environment] The number of instances with Severe health status.
shown as instance
aws.elasticbeanstalk.instances_unknown
(count)
[Environment] The number of instances with Unknown health status.
shown as instance
aws.elasticbeanstalk.instances_warning
(count)
[Environment] The number of instances with Warning health status.
shown as instance
aws.elasticbeanstalk.load_average_1min
(gauge)
[Instance] The average CPU load over the last minute.
aws.elasticbeanstalk.load_average_5min
(gauge)
[Instance] The average CPU load over the last five minutes.
aws.elasticbeanstalk.root_filesystem_util
(gauge)
[Instance] The percentage of disk space in use.
shown as percent

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

Events

The AWS Elastic Beanstalk integration does not include any event at this time.

Service Checks

The AWS Elastic Beanstalk integration does not include any service check at this time.

Troubleshooting

Need help? Contact Datadog Support.

Further Reading