Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ services:
- "5000:5000"
volumes:
- ./web:/code # modified here to take into account the new app path
links:
- redis
environment:
- DATADOG_HOST=datadog # used by the web app to initialize the Datadog library
redis:
image: redis
ports:
- "6379:6379"
# agent section
datadog:
build: datadog
links:
- redis # ensures that redis is a host that the container can find
- web # ensures that the web app can send metrics
environment:
- DD_API_KEY=__your_datadog_api_key_here__
- DD_DOGTAND_NON_LOCAL_TRAFFIC=true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /proc/:/host/proc/:ro
- /sys/fs/cgroup:/host/sys/fs/cgroup:ro
ports:
- "8125:8125/udp"
```

# Configuring the Agent
Expand All @@ -60,11 +60,11 @@ FROM datadog/agent:latest
ADD conf.d/redisdb.yaml /etc/datadog-agent/conf.d/redisdb.yaml
```

And the Compose yaml files creates the link to redis with:
And the Compose yaml files opens the port on the host for other containers to connect to:

```yaml
links:
- redis
ports:
- "8125:8125/udp"
```

# All in one
Expand All @@ -75,4 +75,4 @@ How to test this?
1. Clone this repository
1. Update your `DD_API_KEY` in `docker-compose.yml`
1. Run all containers with `docker-compose up`
1. Verify in Datadog that your container picks up the docker and redis metrics
1. Verify in Datadog that your container picks up the docker and redis metrics
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ services:
- "5000:5000"
volumes:
- ./web:/code # modified here to take into account the new app path
links:
- redis
environment:
- DATADOG_HOST=datadog # used by the web app to initialize the Datadog library
redis:
image: redis
ports:
- "6379:6379"
# agent section
datadog:
build: datadog
Expand All @@ -26,3 +26,5 @@ services:
- /var/run/docker.sock:/var/run/docker.sock
- /proc/:/host/proc/:ro
- /sys/fs/cgroup:/host/sys/fs/cgroup:ro
ports:
- "8125:8125/udp"