Edit

Automatic data collection and resource detectors for Azure Monitor OpenTelemetry

This article explains how Azure Monitor OpenTelemetry collects telemetry automatically and how resource detectors enrich telemetry with consistent metadata. You learn what signals are collected by default and how resource detectors populate attributes like service identity and environment details so your Application Insights data is easier to filter, correlate, and troubleshoot across .NET, Java, Node.js, and Python applications.

To learn more about OpenTelemetry concepts, see the OpenTelemetry overview.

Note

For Azure Function Apps, see Use OpenTelemetry with Azure Functions.

Included instrumentation libraries

The Azure Monitor Distros automatically collect data by bundling OpenTelemetry instrumentation libraries.

Requests

Dependencies

Logging

  • ILogger

For more information about ILogger, see Logging in C# and .NET and code examples.

Footnotes

  • ¹: Supports automatic reporting of unhandled/uncaught exceptions
  • ²: Supports OpenTelemetry Metrics

Note

The Azure Monitor OpenTelemetry Distros include custom mapping and logic to automatically emit Application Insights standard metrics. For billing purposes, all OpenTelemetry metrics, whether automatically collected from instrumentation libraries or manually collected from custom coding, are currently considered Application Insights custom metrics. Learn more.

Tip

To reduce or increase the number of logs sent to Azure Monitor, configure logging to set the appropriate log level or apply filters. For example, you can choose to send only WARNING and ERROR logs to Azure Monitor.

Resource detectors

Resource detectors discover environment metadata at startup and populate OpenTelemetry resource attributes such as service.name, cloud.provider, and cloud.resource_id. This metadata powers experiences in Application Insights like Application Map and compute linking, and it improves correlation across traces, metrics, and logs.

Tip

Resource attributes describe the process and its environment. Span attributes describe a single operation. Use resource attributes for app-level properties like service.name.

Supported environments

Environment How detection works Notes
Azure App Service The language SDK or Azure Monitor Distro reads well-known App Service environment variables and host metadata Works with .NET, Java, Node.js, and Python when you use the guidance in this article.
Azure Functions See the Azure Functions OpenTelemetry how‑to All Azure Functions guidance lives there.
Azure Virtual Machines The language SDK or distro queries the Azure Instance Metadata Service Ensure the VM has access to the Instance Metadata Service endpoint.
Azure Kubernetes Service (AKS) Use the OpenTelemetry Collector k8sattributes processor to add Kubernetes metadata Recommended for all languages running in AKS.
Azure Container Apps Detectors map environment variables and resource identifiers when available You can also set OTEL_RESOURCE_ATTRIBUTES to fill gaps.

OTLP ingestion considerations

  • cloud.resource_id improves compute linking to Azure resources. If this attribute is missing, some experiences might not show the Azure resource that produced the data.

  • Application Insights uses service.name to derive Cloud Role Name. Choose a stable name per service to avoid fragmented nodes in Application Map.

  • cloud.resource_id improves compute linking to Azure resources. If this attribute is missing, some experiences might not show the Azure resource that produced the data.

Troubleshooting, feedback, and support

Tip

The following sections are available across all OpenTelemetry Distro articles.

Troubleshooting

OpenTelemetry Feedback

To provide feedback:

Support

Select a tab for the language of your choice to discover support options.

Next steps