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.
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
- This feature is in preview. Preview features are provided without a service-level agreement and aren't recommended for production workloads.
- For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
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:
- OpenTelemetry Collector - Send data directly to Azure Monitor cloud ingestion endpoints from any OTel Collector deployment. For more information, see Ingest OTLP data into Azure Monitor with OTel Collector.
- Azure Monitor Agent (AMA) - Ingest data from applications running on Azure VMs, Virtual Machine Scale Sets, or Azure Arc-enabled servers.
- Azure Kubernetes Service (AKS) add-on - Collect telemetry from containerized applications in AKS clusters. For more information, see Enable Azure Monitor OpenTelemetry for Kubernetes clusters.
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.
Option 1: Create an Application Insights resource with OTLP support (Recommended)
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.
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.InsightsIn the Azure portal, create a new Application Insights resource.
On the Basics tab, select the Enable OTLP support checkbox.
Complete the resource creation process.
After deployment, go to the Overview page of your Application Insights resource.
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)
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:
- Create an Application Insights resource in the same region as your workspaces.
- Clear the Enable OTLP support checkbox to avoid creating duplicate resources.
- 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
- In the Azure portal, search for Deploy a custom template and select it.
- Select Build your own template in the editor.
- Copy the template content from the Azure Monitor Community repository.
- 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_. - Set the location to match your workspace region.
- Review and create the deployment.
- 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:
- Go to your DCR in the Azure portal.
- Under Configuration, select Resources.
- 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:
Add the
microsoft.applicationIdresource attribute with the Application Insights connection string application ID (the GUID portion afterInstrumentationKey=). 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.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.