Edit

Ingest OTLP data into Azure Monitor by using OTel Collector (Preview)

Azure Monitor now supports native ingestion of OpenTelemetry Protocol (OTLP) signals. You can send telemetry data directly from OpenTelemetry-instrumented applications to Azure Monitor.

Important

Overview

Azure Monitor can receive OTLP signals through three ingestion mechanisms:

  • OpenTelemetry Collector - Send data directly to Azure Monitor cloud ingestion endpoints from any OTel Collector deployment.
  • Azure Monitor Agent (AMA) - Ingest data from applications running on Azure virtual machines (VMs), Virtual Machine Scale Sets, or Azure Arc-enabled servers.
  • Azure Kubernetes Service (AKS) add-on - Collect telemetry from containerized applications in AKS clusters. See Enable Azure Monitor OpenTelemetry for Kubernetes clusters for details.

This article covers the OTel Collector method of collecting OTLP signals.

Prerequisites

  • Azure subscription: If you don't have one, create an Azure subscription for free.
  • OpenTelemetry SDK instrumented application (any supported language).
  • For OpenTelemetry Collector deployments: Collector version 0.132.0 or higher with the Azure Authentication extension.

Set up OTLP data ingestion

You can configure OTLP data ingestion in Azure Monitor by using one of two approaches. The Application Insights-based approach is recommended for most scenarios as it automates resource creation and enables built-in troubleshooting experiences.

This method automatically provisions all required Azure resources and configures their relationships. You can use Application Insights for application performance monitoring, distributed tracing, and failure analysis.

  1. Register the Application Insights OTLP preview features and provider.

    az feature register --name OtlpApplicationInsights --namespace Microsoft.Insights
    az feature list -o table --query "[?contains(name, 'Microsoft.Insights/OtlpApplicationInsights')].{Name:name,State:properties.state}"
    
    az provider register -n Microsoft.Insights
    
  2. In the Azure portal, create a new Application Insights resource.

  3. On the Basics tab, select the Enable OTLP support checkbox.

    Screenshot showing the Create Application Insights page with Enable OTLP support option selected.

  4. Complete the resource creation process.

  5. After deployment, go to the Overview page of your Application Insights resource.

  6. In the OTLP Connection Info section, copy the following values:

    • The Data Collection Rule (DCR) resource ID
    • The endpoint URLs for traces, logs, and metrics (if you're using OpenTelemetry Collector)

    Screenshot showing OTLP connection information on the Application Insights Overview page.

Proceed to Configure your OpenTelemetry Collector.

Option 2: Manual resource orchestration

This option requires you to manually create and configure Data Collection Endpoints (DCE), Data Collection Rules (DCR), and destination workspaces. Use this approach when you need custom configurations or want to reuse existing resources.

Create destination workspaces

If you don't have existing workspaces, create the following resources in the same Azure region:

  • Log Analytics workspace (LAW) - Stores log and trace data
  • Azure Monitor workspace (AMW) - Stores metrics data

Record the resource IDs of both workspaces for later use.

(Optional) Create an Application Insights resource

To enable Application Insights troubleshooting experiences with your OTLP data:

  1. Create an Application Insights resource in the same region as your workspaces.
  2. Clear the Enable OTLP support checkbox to avoid creating duplicate resources.
  3. Copy the Application Insights resource ID.

Note

If you skip this step, you need to modify the ARM template in the next section to remove Application Insights references.

Deploy the Data Collection Endpoint and Rule

  1. In the Azure portal, search for Deploy a custom template and select it.
  2. Select Build your own template in the editor.
  3. Copy the template content from the Azure Monitor Community repository.
  4. Paste the template into the editor and update the parameters with your workspace resource IDs and (optionally) Application Insights resource ID.
  5. In this example, the stream name from the community DCR template is used to create the URL. You can optionally change the stream name in the DCR definition and match it when creating the DCE name. The stream name should start with Custom-Metrics- followed by a letter and then any combination of alphanumeric characters, -, and _.
  6. Set the location to match your workspace region.
  7. Review and create the deployment.
  8. After deployment completes, navigate to the created DCR and copy its resource ID from the Overview page.

Configure your OpenTelemetry Collector

Note

  • The following Collector configuration uses components from the OpenTelemetry Collector Contrib project and the Azure Authentication Extension to send telemetry data to Azure Monitor. You can also build a custom distribution by using the OpenTelemetry Collector Builder with components from the core and contrib repositories.
  • Support for these open-source components is provided exclusively through community channels. To submit bug reports, request new features, or report other issues, create a new issue in the public repository.
  • Azure support is available for Azure services and resources, including Application Insights, Azure Monitor, and Log Analytics workspaces, as well as Data Collection Rules and Data Collection Endpoints.

Configure Microsoft Entra authentication

The OpenTelemetry Collector requires Microsoft Entra authentication to send data to Azure Monitor.

For Azure VMs and Virtual Machine Scale Sets:

  1. Enable system-assigned managed identity on your compute resource.
  2. Assign the Monitoring Metrics Publisher role to the managed identity.
  3. To use the system-assigned identity, leave the managed_identity section blank in your collector configuration.

For non-Azure environments:

Configure the Azure Authentication extension in your collector with an appropriate Microsoft Entra identity:

extensions:
  azureauth/monitor:
    managed_identity:
      client_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"  # Your identity client ID
    scopes:
      - https://monitor.azure.com/.default

For workload identities, service principals, or other Microsoft Entra identities, provide the client_id of the identity that needs to authenticate.

Grant permissions to the Data Collection Rule

The identity your collector uses needs permission to write data to your DCR:

  1. Go to your DCR in the Azure portal.

  2. Select Access control (IAM) in the left navigation.

  3. Select Add > Add role assignment.

    Screenshot showing how to add a role assignment to a Data Collection Rule.

  4. Select Monitoring Metrics Publisher and select Next.

    Screenshot showing the Monitoring Metrics Publisher role selection.

  5. For Assign access to, select User, group, or service principal.

  6. Select Select members and choose your application or managed identity.

    Screenshot showing member selection for role assignment.

  7. Select Review + assign to save the role assignment.

Construct endpoint URLs

If you created your resources by using the Application Insights method, you already have the endpoint URLs from the OTLP Connection Info section. Skip to Update collector configuration.

You can optionally change the stream name in the Data Collection Rule (DCR) definition, but the stream name used in the DCR must exactly match the stream name used when constructing the Data Collection Endpoint (DCE) URL, and this match is case-sensitive. The stream name must start with Custom-Metrics-, followed by a letter, and then any combination of alphanumeric characters, hyphens (-), or underscores (_). If you change the stream name, you must update all references to the stream name in the DCR template and ensure the DCE URL uses the same value.

For manually orchestrated resources, construct the endpoint URLs:

  1. Go to your Data Collection Endpoint in the Azure portal.

  2. Select JSON View from the Overview page.

  3. Copy the logsIngestion and metricsIngestion endpoint values:

    "logsIngestion": {
        "endpoint": "https://<name>.<location>-1.ingest.monitor.azure.com"
    },
    "metricsIngestion": {
        "endpoint": "https://<name>.<location>-1.metrics.ingest.monitor.azure.com"
    }
    
  4. Go to your Data Collection Rule and copy the Immutable ID from the Overview page.

  5. Construct your endpoint URLs by using this pattern:

    Metrics endpoint:

    https://<metrics-dce-domain>/datacollectionRules/<dcr-immutable-id>/streams/Custom-Metrics-OTEL/otlp/v1/metrics
    

    Logs endpoint:

    https://<logs-dce-domain>/datacollectionRules/<dcr-immutable-id>/streams/Microsoft-OTLP-Logs/otlp/v1/logs
    

    Traces endpoint:

    https://<logs-dce-domain>/datacollectionRules/<dcr-immutable-id>/streams/Microsoft-OTLP-Traces/otlp/v1/traces
    

    Note

    The traces endpoint uses the logs DCE domain.

Update collector configuration

Configure your OpenTelemetry Collector with the authentication extension and Azure Monitor endpoints. Here's a sample configuration:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: localhost:4317
      http:
        endpoint: localhost:4318

processors:
  batch:

extensions:
  azureauth/monitor:
    use_default: true
    scopes:
      - https://monitor.azure.com/.default

exporters:
  otlphttp/azuremonitor:
    traces_endpoint: "https://<logs-dce-domain>/datacollectionRules/<dcr-immutable-id>/streams/<strong>Microsoft-OTLP-Traces</strong>/otlp/v1/traces"
    logs_endpoint: "https://<logs-dce-domain>/datacollectionRules/<dcr-immutable-id>/streams/<strong>Microsoft-OTLP-Logs</strong>/otlp/v1/logs"
    metrics_endpoint: "https://<metrics-dce-domain>/datacollectionRules/<dcr-immutable-id>/streams/microsoft-otelmetrics/otlp/v1/metrics"
    auth:
      authenticator: azureauth/monitor

service:
  extensions:
    - azureauth/monitor
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/azuremonitor]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/azuremonitor]
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/azuremonitor]

Important

  • Application Insights experiences, including prebuilt dashboards and queries, expect and require OTLP metrics with delta temporality and exponential histogram aggregation.

  • If you emit OTLP metrics from an OpenTelemetry SDK, configure your OTLP exporter to produce the metrics with delta temporality. For more information, see Metrics Exporters - OTLP.

  • If the OpenTelemetry collector receives OTLP metrics in cumulative temporality, add processors: [cumulativetodelta] to the metrics section of the OpenTelemetry collector config to convert to delta. For more information, see cumulativetodeltaprocessor on GitHub.

Next steps