![]() |
VOOZH | about |
This document provides configuration steps for using the Datadog Agent to send logs to a Datadog BYOC (Bring Your Own Cloud) Logs deployment. Unlike the Datadog SaaS platform, BYOC Logs requires specific Agent configurations to ensure logs are enriched with necessary host-level tags and sent to the correct endpoint. This guide covers how to set these configurations for the most common deployment methods.
To send logs with the Datadog Agent to BYOC Logs, you must configure two environment variables:
DD_LOGS_CONFIG_LOGS_DD_URLhttp://<RELEASE_NAME>-indexer.<NAMESPACE_NAME>.svc.cluster.local:7280. This tells the Agent where to send the logsDD_LOGS_CONFIG_EXPECTED_TAGS_DURATIONIf you have configured the Datadog Agent to use a proxy and BYOC Logs is hosted in your internal network, you need to configure the no_proxy setting so the Agent can send logs directly to BYOC Logs without passing through the proxy.
# In the no_proxy section, add the BYOC Logs DNSno_proxy:- http://<RELEASE_NAME>-indexer.<NAMESPACE_NAME>.svc.cluster.local:7280Additionally, you need to set DD_NO_PROXY_NONEXACT_MATCH to true. For more details, see Datadog Agent Proxy Configuration.
To deploy the Agent on Kubernetes using the Datadog Operator, follow the Getting Started with Datadog Operator guide. When you reach Step 3, use the following datadog-agent.yaml configuration instead of the example provided in the guide.
apiVersion:datadoghq.com/v2alpha1kind:DatadogAgentmetadata:name:datadogspec:global:clusterName:<CLUSTER_NAME>site:datadoghq.comcredentials:apiSecret:secretName:datadog-secretkeyName:api-keyenv:- name:DD_LOGS_CONFIG_LOGS_DD_URLvalue:http://<RELEASE_NAME>-indexer.<NAMESPACE_NAME>.svc.cluster.local:7280- name:DD_LOGS_CONFIG_EXPECTED_TAGS_DURATIONvalue:"100000"features:logCollection:enabled:truecontainerCollectAll:trueotlp:receiver:protocols:grpc:enabled:trueendpoint:0.0.0.0:4417prometheusScrape:enabled:trueenableServiceEndpoints:trueThe Datadog Agent can be configured to send logs to BYOC Logs using different endpoints:
You can also configure additional features to send cluster metadata to Datadog:
If you are not using the Datadog Operator, you can deploy the Agent using one of these common methods:
Run the following command to deploy the Agent using the Helm chart, setting the log-specific environment variables directly.
helm install datadog-agent datadog/datadog \
--set datadog.apiKey=<YOUR_API_KEY> \
--set datadog.logs.enabled=true \
--set datadog.logs.containerCollectAll=true \
--set datadog.logsConfigContainerCollectAll=true \
--set agents.containers.agent.env[0].name=DD_LOGS_CONFIG_LOGS_DD_URL \
--set agents.containers.agent.env[0].value=http://<RELEASE_NAME>-indexer.<NAMESPACE_NAME>.svc.cluster.local:7280
For custom deployments, set the environment variable in your DaemonSet:
apiVersion:apps/v1kind:DaemonSetmetadata:name:datadog-agentspec:template:spec:containers:- name:agentimage:registry.datadoghq.com/agent:latestenv:- name:DD_API_KEYvalue:<YOUR_API_KEY>- name:DD_LOGS_ENABLEDvalue:"true"- name:DD_LOGS_CONFIG_CONTAINER_COLLECT_ALLvalue:"true"- name:DD_LOGS_CONFIG_LOGS_DD_URLvalue:"http://<RELEASE_NAME>-indexer.<NAMESPACE_NAME>.svc.cluster.local:7280"After the Agent is deployed, you can verify that logs are being sent and received correctly.
Use kubectl exec to check the Agent’s status and confirm it is configured to send logs.
# Check Agent status and logs configuration
kubectl exec -it <datadog-agent-pod> -- agent status | grep -A 10 "Logs Agent"
# Check Agent logs for BYOC Logs connection
kubectl logs <datadog-agent-pod> | grep -i cloudprem
Run this command to query the BYOC Logs searcher and verify that it’s indexing the JSON logs.
kubectl exec -it <RELEASE_NAME>-searcher-0 -n <NAMESPACE_NAME> -- curl 'http://localhost:7280/api/v1/datadog/search?query='
Agent not sending logs:
DD_LOGS_CONFIG_LOGS_DD_URL environment variable is set correctlykubectl logs <datadog-agent-pod>DD_LOGS_ENABLED=trueBYOC Logs not receiving logs:
kubectl logs -n <NAMESPACE_NAME> -l app=<RELEASE_NAME>-indexerkubectl get pods -n <NAMESPACE_NAME>Additional helpful documentation, links, and articles:
| |