Catalogue
Datadog Agent for ECS Launch Type=EC2

Datadog Agent for ECS Launch Type=EC2

🌐 日本語で読む

Overview

On ECS launch type EC2, I set datadog/agent:latest in the task definition, but
there was an issue where metrics could not be collected.

Under Infrastructure > Containers, the container information from the task definition that included datadog/agent:latest was listed, but the metrics were not being collected.

Conclusion

Referring to ttps://docs.datadoghq.com/json/datadog-agent-ecs.json, the following volume mount configuration was required.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
datadog:
image: datadog/agent:latest
environment:
DD_API_KEY: ${DD_API_KEY}
logging:
driver: awslogs
options:
awslogs-group: ${LOG_GROUP}
awslogs-region: ${REGION}
awslogs-stream-prefix: datadog
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /proc/:/host/proc:ro
- /sys/fs/cgroup/:/host/sys/fs/cgroup:ro

It was a painful reminder to read the documentation carefully.

References

Amazon Elastic Container Service (ECS)

kenzo0107

kenzo0107