Skip to content

Instantly share code, notes, and snippets.

@ajazfarhad
Created May 12, 2020 13:00
Show Gist options
  • Save ajazfarhad/0af0c81ab1e2e480a1b77bbadc5f4e91 to your computer and use it in GitHub Desktop.
Save ajazfarhad/0af0c81ab1e2e480a1b77bbadc5f4e91 to your computer and use it in GitHub Desktop.
docker-compose file for Rails API and Datadog Agent
version: "3.7"
services:
db:
image: postgres
environment:
POSTGRES_PASSWORD: password
volumes:
- ./tmp/db:/var/lib/postgresql/data
app:
container_name: rails_api
build:
context: .
dockerfile: config/containers/app/Dockerfile
depends_on:
- db
ports:
- '3001:3000'
volumes:
- .:/var/www/app
labels:
com.datadoghq.ad.logs: '[{"source": "ruby", "service": "app"}]'
environment:
PG_PASSWORD: password
DATADOG_HOST: datadog
# agent section
datadog:
image: "datadog/agent:latest"
environment:
- DD_API_KEY=${DD_API_KEY}
- DD_LOGS_ENABLED=true
- DD_AC_INCLUDE="name:rails_api"
- DD_PROCESS_AGENT_ENABLED=true
- DD_SITE=datadoghq.eu
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /proc/:/host/proc/:ro
- /sys/fs/cgroup/:/host/sys/fs/cgroup:ro
@ajazfarhad
Copy link
Author

Hm, i will try to figure out what's happening. Just to confirm something in which region do you have your DataDog account in EU or US ?

@sevetseh28
Copy link

It's EU, I have that setup correctly. So the connection is OK because if I enable the APM it's working correctly and showing up.
But now I'm troubleshooting the Logs collection that's not working. TY

@ajazfarhad
Copy link
Author

ajazfarhad commented Dec 18, 2020

Things seems to be fine in terms of setup. Also if you already have performed auto-discovery troubleshooting. Then you might need to speak with DD support they can investigate by looking into the Agent Flare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment