Skip to content

Commit

Permalink
feat: Adding debuggable otel collector
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Aug 23, 2023
1 parent d0749d6 commit 60bd718
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion sources/docker
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,42 @@ if command -v docker >/dev/null 2>&1; then
}

otel-collector() {
docker run --name otel-collector --rm --publish "127.0.0.1:4317:4317/tcp" otel/opentelemetry-collector
local OTEL_CONFIG_FILE="${HOME}/Downloads/otel-collector.yaml"

cat >"${OTEL_CONFIG_FILE}" <<EOF
---
receivers:
otlp:
protocols:
grpc:
exporters:
logging:
verbosity: detailed
service:
pipelines:
metrics:
receivers:
- otlp
exporters:
- logging
traces:
receivers:
- otlp
exporters:
- logging
EOF

docker run \
--name otel-collector \
--rm \
--publish "127.0.0.1:4317:4317/tcp" \
--volume "${OTEL_CONFIG_FILE}:/var/config.yaml:ro" \
otel/opentelemetry-collector -- --config "/var/config.yaml"

rm -f "${OTEL_CONFIG_FILE}"
}

datadog_agent() {
Expand Down

0 comments on commit 60bd718

Please sign in to comment.