This file contains the Datadog Agent configuration.The configuration shown below assumes you want all Datadog features covered in this guide (logging, traces, and custom metrics).
site: <your-datadog-site> # e.g. us5.datadoghq.comhostname: pipecat.daily.co # (or whatever would be useful for you to see in the Datadog dashboards)# Include the following line only if you need logging (see "Enabling Logging")logs_enabled: true# Uncomment the below lines if you DON'T need traces (see "Enabling Traces")# apm_config:# enabled: false# Uncomment the below lines if you DON'T need custom metrics (see "Enabling Custom Metrics")# use_dogstatsd: falsekubelet_tls_verify: falseautoconfig_exclude_features: - kubernetes - orchestratorexplorer
This script runs before the agent launcher runs.The file shown below assumes you want all Datadog features covered in this guide (logging, traces, and custom metrics).
#!/bin/bash# Write the Datadog API key to the config fileecho "api_key: $DD_API_KEY" >> /etc/datadog-agent/datadog.yaml# Start the Datadog Agent serviceservice datadog-agent start || true# Include the below line only if you need traces (see "Enabling Traces")# HACK: here we restart the Datadog Trace Agent specifically, since we know it failed to start aboveservice datadog-agent-trace restart || true## DEBUGGING# Check the status of the Datadog Agent subsystems for logging, custom metrics, and traces# service datadog-agent status# service datadog-agent-trace status# datadog-agent status# Display the Datadog agent log# cat /var/log/datadog/agent.log
You may see Starting Datadog Agent: datadog-agent failed! in your logs,
triggered by service datadog-agent start. You can safely ignore this! As
long as service datadog-agent status and service datadog-agent-trace status indicate that both of those services end up running, then we should
have no trouble sending logs, traces, and custom metrics to Datadog.
The snippet shown below assumes you want all Datadog features covered in this guide (logging, traces, and custom metrics).
# Install the Datadog Agent# (note that you can literally use "dummy"—or anything else—as the API key)RUN apt-get -y update; apt-get -y install curlRUN DD_API_KEY=dummy \ DD_INSTALL_ONLY=true \ bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)"# Configure Datadog AgentCOPY ./datadog.yaml /etc/datadog-agent# Include the below line if you need logging (see "Enabling Logging")COPY ./python.d /etc/datadog-agent/conf.d/python.d# Include the below lines only if you need traces or custom metrics (see "Enabling Traces" or "Enabling Custom Metrics")# Prepare file system for the Datadog Agent to use for Unix SocketsRUN mkdir -p /var/run/datadog/RUN chown dd-agent:dd-agent /var/run/datadog/# Start Datadog Agent (move pre-app script to expected place where it'll be invoked by Pipecat Cloud base image)COPY --chmod=755 ./pre-app.sh /app/
# Use whatever agent name would be useful for you to see in the Datadog dashboardlogs: - type: file path: /var/log/<my-agent-name>/datadog.log service: <my-agent-name> source: python sourcecategory: sourcecode