DataDog( APM, Logging, and Container Log Exclusion )
📘 Datadog Agent Helm Configuration – APM, Logging, and Log Exclusion 🧾 Summary This KB article documents how to configure the Datadog Agent using Helm in a Kubernetes cluster. The configuration enables APM (tracing), continuous profiling , and log collection , while ensuring logs are only collected from specific containers using image-based filtering . ⚙ Helm Configuration Overview The following values.yaml snippet shows how the Datadog Agent is configured: datadog: targetSystem: "linux" # Required for Helm deployments on Linux systems apiKeyExistingSecret: clusterName: apm: enabled: true portEnabled: true trace: enabled: true sampleRate: 1 # Enables 100% trace sampling traceAnalytics: enabled: true logsInjection: enabled: true profiling: enabled: true runtime: enabled: true logs: enabled: true containerCollectAll: true containerCollectUsingFiles: false processAgent: enabled: true containerExclude: "image:." containerInclude: > image:/ 🔍 Configuration Breakdown Key Features Enabled Name FeatureDescription targetSystem Ensures compatibility with Linux-based clusters APM & Tracing Enables Distributed Tracing with full (100%) sample rate Logs Injection Correlates logs with traces for better observability Continuous Profiling Captures runtime performance over time Runtime Metrics Collects application-level metrics from containers Process Agent Enables process-level monitoring 📦 Log Collection Rules The following rules control which container logs are collected: containerExclude: "image:." This excludes log collection for all containers by default. containerInclude Only the listed images are allowed through the filter and have their logs collected. These should be full image references. ⚠ Important: Manual Maintenance Required Using image: filters for log collection means that any change in image name or tag will require a manual update to the containerInclude list in values.yaml 🧩 Related: Tracing Library Injection (Pod-Level) To enable automatic injection of the Datadog tracing library into application pods, ensure the following are added to your pod spec: metadata: labels: admission.datadoghq.com/enabled: "true" annotations: admission.datadoghq.com/js-lib.version: "latest" These allow the Datadog admission controller to inject the appropriate tracing libraries into your pods automatically. Refer to Datadog’s official documentation for more details.
Last updated
Was this helpful?

