Skip to content

Commit

Permalink
Add configs for datadog (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
lojzatran authored Jan 16, 2024
1 parent 23cbc0f commit 9fbe190
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ NEW_RELIC_LICENSE_KEY=
# Dynatrace
DYNATRACE_OTLP_ENDPOINT=https://your-endpoint.live.dynatrace.com/api/v2/otlp
DYNATRACE_API_TOKEN="Api-Token dt0c01.your.key"

# Datadog
DATADOG_API_KEY="your-datadog-key"
DATADOG_SITE="datadoghq.eu"
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ Make sure OpenTelemetry Collector service
in [docker-compose.yml](./docker-compose.yaml) has the Dynatrace command uncommented.
Restart the containers.

## Datadog
The collector is preconfigured to export metric, traces and log entries to Datadog.
In order to activate it add your Datadog API key to the `.env` file. In case you're
registered under another region than EU, update your Datadog site in the `.env` file as well.
Make sure OpenTelemetry Collector service
in [docker-compose.yml](./docker-compose.yaml) has the Datadog command uncommented.
Restart the containers.

## Jaeger UI

http://localhost:16686
Expand Down
7 changes: 6 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,17 @@ services:
memory: 125M
restart: unless-stopped
# New Relic
command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-observability.yml", "--config=/etc/otelcol-config-newrelic.yml" ]
# command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-observability.yml", "--config=/etc/otelcol-config-newrelic.yml" ]
# Dynatrace
# command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-observability.yml", "--config=/etc/otelcol-config-dynatrace.yml" ]
# Datadog
command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-observability.yml", "--config=/etc/otelcol-config-datadog.yml" ]
volumes:
- ./src/otelcollector/otelcol-config.yml:/etc/otelcol-config.yml
- ./src/otelcollector/otelcol-observability.yml:/etc/otelcol-observability.yml
- ./src/otelcollector/otelcol-config-newrelic.yml:/etc/otelcol-config-newrelic.yml
- ./src/otelcollector/otelcol-config-dynatrace.yml:/etc/otelcol-config-dynatrace.yml
- ./src/otelcollector/otelcol-config-datadog.yml:/etc/otelcol-config-datadog.yml
ports:
- "4317:4317" # OTLP over gRPC receiver
- "4318:4318" # OTLP over HTTP receiver
Expand All @@ -84,6 +87,8 @@ services:
- NEW_RELIC_LICENSE_KEY=${NEW_RELIC_LICENSE_KEY}
- DYNATRACE_OTLP_ENDPOINT=${DYNATRACE_OTLP_ENDPOINT}
- DYNATRACE_API_TOKEN=${DYNATRACE_API_TOKEN}
- DATADOG_API_KEY=${DATADOG_API_KEY}
- DATADOG_SITE=${DATADOG_SITE}

# Prometheus
prometheus:
Expand Down
20 changes: 20 additions & 0 deletions src/otelcollector/otelcol-config-datadog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# extra settings to be merged into OpenTelemetry Collector configuration
# do not delete this file

exporters:
datadog:
api:
site: ${DATADOG_SITE}
key: ${DATADOG_API_KEY}
fail_on_invalid_key: true

service:
pipelines:
traces:
exporters: [otlp, logging, spanmetrics, datadog]
metrics:
exporters: [prometheus, logging, datadog]
logs:
exporters: [logging, datadog]

0 comments on commit 9fbe190

Please sign in to comment.