# OpenTelemetry Collector for Claude Code telemetry -> Datadog.
#
# The Datadog exporter lives only in the "contrib" distribution, not the core
# collector image.
#
# NOTE: pin this tag to a tested version (or a digest) before deploying to
# Azure. `latest` is fine for local verification, not for the team.
#
# Registry is fully qualified: podman does not default to Docker Hub for
# unqualified names, so a bare `otel/...` prompts or fails there.
FROM docker.io/otel/opentelemetry-collector-contrib:latest

# Copied to an explicit path so the config location never depends on the
# image's default, which differs between distributions. chown to the image's
# built-in non-root user so readability never depends on checkout file modes.
COPY --chown=10001:10001 collector-config.yaml /etc/otel/config.yaml

# 4318: OTLP http/protobuf (all Claude Code speaks).
# 13133: health_check extension, for orchestrator liveness/readiness probes.
EXPOSE 4318 13133

# DD_API_KEY, DD_SITE and OTLP_BEARER_TOKEN are supplied at runtime, never
# baked into the image.
CMD ["--config=/etc/otel/config.yaml"]
