Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This guide shows how to configure Azure Container Apps to forward logs, traces, and metrics to Datadog by using the managed OpenTelemetry agent.
For more information about the managed OpenTelemetry agent, see Set up OpenTelemetry agents in Azure Container Apps.
What you learn
- Create a Datadog API key for telemetry ingest.
- Configure a Datadog destination in your Container Apps environment by using Bicep, Azure CLI, or the Azure portal.
- Apply configuration updates to your existing Container Apps environment and app.
- Verify telemetry in Datadog.
Prerequisites
- An Azure subscription where you can create resource groups and deploy Azure Container Apps resources.
- A Datadog environment and API key.
- Azure CLI installed and signed in.
- Azure Container Apps CLI extension installed.
az extension add --name containerapp --upgrade
Create a Datadog API key
Create a Datadog API key with permissions that allow telemetry ingest.
You need the following Datadog values for Container Apps managed OTel configuration:
site(full Datadog site value, for example:datadoghq.com,us3.datadoghq.com,us5.datadoghq.com,datadoghq.eu)key(Datadog API key)
For Datadog key creation and management, see Datadog API and application keys.
Configure OpenTelemetry destinations
Use one of the following options to configure Datadog as an OpenTelemetry destination in your Container Apps environment.
Important
Configuring a managed OpenTelemetry destination doesn't automatically produce telemetry. Your application must also be instrumented to emit traces, metrics, and logs by using an OpenTelemetry SDK.
Set CLI variables for the deployment command:
$RESOURCE_GROUP = "<resource-group-name>"
$DATADOG_SITE = "<datadog-site>" # Example: us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu
$DATADOG_API_KEY = ""
$IMAGE = ""
$ACR_USERNAME = ""
$ACR_PASSWORD = ""
Use a managed environment resource block like the following example:
param datadogSite string
@secure()
param datadogApiKey string
var datadogDestinationName = 'dataDog'
resource environment 'Microsoft.App/managedEnvironments@2024-10-02-preview' = {
name: ''
location: ''
properties: {
openTelemetryConfiguration: {
destinationsConfiguration: {
dataDogConfiguration: {
site: datadogSite
key: datadogApiKey
}
}
tracesConfiguration: {
destinations: [
datadogDestinationName
]
}
logsConfiguration: {
destinations: [
datadogDestinationName
]
}
metricsConfiguration: {
destinations: [
datadogDestinationName
]
}
}
}
}
Use a container app resource block like the following example to set required environment variables:
resource app 'Microsoft.App/containerApps@2024-10-02-preview' = {
name: ''
location: ''
properties: {
managedEnvironmentId: environment.id
template: {
containers: [
{
name: ''
image: ''
env: [
{
name: 'OTEL_SERVICE_NAME'
value: ''
}
{
name: 'OTEL_TRACES_EXPORTER'
value: 'otlp'
}
{
name: 'OTEL_METRICS_EXPORTER'
value: 'otlp'
}
{
name: 'OTEL_LOGS_EXPORTER'
value: 'otlp'
}
{
name: 'OTEL_EXPORTER_OTLP_PROTOCOL'
value: 'grpc'
}
]
}
]
}
}
}
For production deployments, pass token values through secure Bicep parameters or Key Vault instead of hardcoding secrets.
After you update the template, deploy the Bicep configuration from the repository root:
az deployment group create `
--resource-group $RESOURCE_GROUP `
--template-file infra/main.bicep `
--parameters @infra/main.parameters.json `
image=$IMAGE `
acrUsername=$ACR_USERNAME `
acrPassword=$ACR_PASSWORD `
datadogSite="$DATADOG_SITE" `
datadogApiKey="$DATADOG_API_KEY"
Your Container App is now configured to send telemetry to Datadog through the managed OpenTelemetry agent.
Verify OpenTelemetry data in Datadog
After you complete the configuration, your container app starts sending telemetry to Datadog through the managed OpenTelemetry agent. Use Datadog to confirm that logs, traces, and metrics are arriving from the application and that the data appears under the expected service and environment context.
Validate results by checking Datadog tools like log exploration, distributed tracing, and metric search. The exact query or navigation path varies depending on the data you inspect.
For more information about data exploration in Datadog, see Datadog observability and telemetry.