Integration Setup for ECS Fargate
Set up integrations for ECS Fargate with Docker Label Annotations.
Add an integration
If you already set up the Container Agent in ECS Fargate, follow these steps to add an integration to your existing cluster.
Update the task definition
- Log in to your AWS Web Console and navigate to the ECS section.
- Choose the cluster the Datadog Agent is running on.
- Click the Tasks tab, then click the Task definition name containing the Datadog Agent Container.
- Click the Create new revision button, then click the Add container button.
- Enter the Container name, Image, and any additional preference settings.
- Under Docker labels add the following:
Key | Value |
---|
com.datadoghq.ad.instances | [{"host": "%%host%%", "port": <PORT_NUMBER>}] |
com.datadoghq.ad.check_names | ["<CHECK_NAME>"] |
com.datadoghq.ad.init_configs | [{}] |
- Click the Add button, then click the Create button.
Update the service
- Within the cluster, click the Services tab, then click the Service Name.
- Click the Update button.
- For the Task Definition, choose the latest Revision from the dropdown menu.
- Click the Next step button 3 times, then click the Update Service button.
Verification
When the updated Task displays a RUNNING status, use these pages to verify information is reporting to Datadog:
Examples
Use the following table to enter the Docker labels via the AWS Web Console for a Redis container:
Key | Value |
---|
com.datadoghq.ad.instances | [{"host": "%%host%%", "port": 6379}] |
com.datadoghq.ad.check_names | ["redisdb"] |
com.datadoghq.ad.init_configs | [{}] |
Use the following JSON under containerDefinitions
to create a Redis container via the AWS CLI tools.
{
"name": "redis",
"image": "redis:latest",
"essential": true,
"dockerLabels": {
"com.datadoghq.ad.instances": "[{\"host\": \"%%host%%\", \"port\": 6379}]",
"com.datadoghq.ad.check_names": "[\"redisdb\"]",
"com.datadoghq.ad.init_configs": "[{}]"
}
}
Further Reading
Additional helpful documentation, links, and articles: