Edit

Ingest OTLP data into Azure Monitor by using AMA (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

Tip

For a conceptual overview of OpenTelemetry options in Azure Monitor — native OTLP ingestion, the Microsoft OpenTelemetry distro, and end-to-end observability experiences — see OpenTelemetry with Azure Monitor.

Overview

Azure Monitor can receive OTLP signals through three ingestion mechanisms:

This article covers the Azure Monitor Agent 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 VMs and Virtual Machine Scale Sets deployments: Azure Monitor Agent version 1.38.1 or higher (Windows) or 1.37.0 or higher (Linux).

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 creates 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:

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

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

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.

    Note

    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 _.

  5. Set the location to match your workspace region.
  6. Review and create the deployment.
  7. After deployment completes, go to the created DCR and copy its resource ID from the Overview page.

Deploy Azure Monitor Agent

Install the Azure Monitor Agent by using Azure CLI or PowerShell. For detailed instructions, see Install and manage Azure Monitor Agent.

Verify that you're installing the minimum required version:

  • Windows: Version 1.38.1 or higher
  • Linux: Version 1.37.0 or higher

Associate the DCR with your compute resources

Create an association between your Data Collection Rule and the VMs, Virtual Machine Scale Sets, or Arc-enabled servers running your instrumented applications:

  1. Go to your DCR in the Azure portal.
  2. Under Configuration, select Resources.
  3. Select Add and choose the compute resources to associate.

For programmatic association, see Manage data collection rule associations.

Configure application environment

Set the following configuration in your application environment:

  1. Add the microsoft.applicationId resource attribute with the Application Insights connection string application ID (the GUID portion after InstrumentationKey=). This attribute is required if Application Insights creates the DCR in use. It's also required if you include the Application Insights ID in the manually created DCR to separate ingested data per Application Insights resource.

  2. Configure the OpenTelemetry SDK to send data to localhost by using these ports:

    • Metrics: Port 4317 (gRPC)
    • Logs and Traces: Port 4319 (gRPC)

You might need to alter your OTLP exporter to separate metrics versus logs and traces data across these ports.

Important

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

Example environment variable configuration

Here's an example configuration for setting environment variables. microsoft.applicationId is required if using App Insights based DCR.

export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT="http://localhost:4317"
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://localhost:4319"
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT="http://localhost:4319"
export OTEL_RESOURCE_ATTRIBUTES="microsoft.applicationId=<your-application-id>"
export OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta
export OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION=base2_exponential_bucket_histogram

Note

The Azure Monitor Agent running on the VM handles authentication and routing to Azure Monitor endpoints.

Authentication and permissions

OTLP ingestion through Azure Monitor Agent (AMA) uses a data collection rule (DCR) to associate supported Azure resources with OTLP ingestion endpoints, including virtual machines, virtual machine scale sets, and Azure Arc–enabled servers. AMA retrieves its settings from Azure Monitor and sends telemetry through the ingestion pipeline. The agent doesn't require separate permissions or role assignments.

In contrast, direct ingestion methods such as the OpenTelemetry Collector send OTLP telemetry to Azure Monitor ingestion endpoints from external sources or service. For these scenarios, authenticate by using a Microsoft Entra identity. Then use RBAC to assign the Monitoring Metrics Publisher role on the DCR to the identity used by the OpenTelemetry Collector.

For more information about Collector-specific setup, see Ingest OTLP data into Azure Monitor by using OTel Collector.

Next steps