This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Datadog OpenTelemetry Collector project that builds a custom OTel agent with Datadog integration. The project extends the Datadog Agent with OpenTelemetry capabilities using a custom manifest and configuration.
- Dockerfile: Multi-stage build that clones the Datadog Agent source, builds a custom OTel collector using the manifest.yaml, and creates a final image with the built binary
- manifest.yaml: Defines the OpenTelemetry Collector components (receivers, processors, exporters, connectors) and their versions to include in the build
- config.yaml: OpenTelemetry Collector configuration with OTLP receivers, Datadog exporters, and a routing connector for traces/metrics
This collector includes several specialized components for Kubernetes and Datadog integration:
- k8sclusterreceiver: Collects cluster-level metrics like node status, pod counts, and resource utilization
- k8sobjectsreceiver: Monitors Kubernetes object changes and events for logs and metrics
- kubeletstatsreceiver: Gathers detailed container and pod statistics from the kubelet API
- routingconnector: Routes telemetry data based on configurable criteria, enabling complex data flow patterns
- datadog/connector: Custom Datadog connector for generating metrics from trace data
For detailed information about customizing components, see the Datadog OpenTelemetry Collector documentation.
The Docker build:
- Uses the Datadog Agent source code from GitHub
- Installs Go and Python dependencies
- Uses the
ddatool to generate collector code based on manifest.yaml - Builds the OTel agent binary
- Copies the binary into the final Datadog Agent image
Build the Docker image:
docker build -t agent-ddot .Build with custom agent version:
docker build --build-arg AGENT_VERSION=7.65.0-full --build-arg AGENT_BRANCH=7.65.x -t agent-ddot .Run the container:
docker run -e DD_API_KEY=your_key -e DD_SITE=datadoghq.com agent-ddotmanifest.yaml- Controls which OTel components are included in the buildconfig.yaml- Runtime configuration for the OTel collectorDockerfile- Build instructions and multi-stage setup.github/workflows/docker-publish.yml- CI/CD pipeline for automated builds