Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: OpenTelemetry collector #649

Merged
Merged
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
16 changes: 7 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,19 @@ services:
placement:
constraints:
- node.hostname==postgres
datadog-agent:
image: datadog/agent
restart: always
networks:
user-net:
otel-collector:
image: otel/opentelemetry-collector-contrib:0.72.0
command: [--config=/etc/otel-collector-config.yaml]
volumes:
- ./extras/otel/otel-collector-config.yaml:/etc/otel-collector-config.yaml
# Pull docker stats
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: always
networks:
user-net:
environment:
- DD_APM_ENABLED=true
- DD_APM_NON_LOCAL_TRAFFIC=true
- DD_SITE=datadoghq.eu
- DD_API_KEY=${DD_API_KEY}
- DD_ENV=${DD_ENV}
- DD_CONTAINER_LABELS_AS_TAGS={"project.name":"project_name"}
deploy:
placement:
constraints:
Expand Down
63 changes: 63 additions & 0 deletions extras/otel/otel-collector-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
receivers:
otlp:
protocols:
grpc:
# The hostmetrics receiver is required to get correct infrastructure metrics in Datadog.
hostmetrics:
collection_interval: 10s
scrapers:
paging:
metrics:
system.paging.utilization:
enabled: true
cpu:
metrics:
system.cpu.utilization:
enabled: true
disk:
filesystem:
metrics:
system.filesystem.utilization:
enabled: true
load:
memory:
network:
processes:
# The prometheus receiver scrapes metrics needed for the OpenTelemetry Collector Dashboard.
prometheus/otel:
config:
scrape_configs:
- job_name: 'otelcol'
scrape_interval: 10s
static_configs:
- targets: ['0.0.0.0:8888']
docker_stats:
endpoint: unix:///var/run/docker.sock

processors:
batch:
attributes:
actions:
- key: env
value: $(env:DD_ENV)
action: insert

exporters:
datadog:
api:
site: datadoghq.eu
key: ${env:DD_API_KEY}
service:
pipelines:
traces:
receivers: [otlp]
processors: [attributes, batch]
exporters: [datadog]
logs:
receivers: [otlp]
processors: [attributes, batch]
exporters: [datadog]
metrics:
receivers: [hostmetrics, prometheus/otel, docker_stats, otlp]
processors: [batch]
exporters: [datadog]