Azure Monitor: A Comprehensive and Practical Observability Strategy with OpenTelemetry
As cloud-native applications grow in complexity, having a robust observability strategy becomes indispensable. Azure Monitor, Microsoft’s unified observability platform, paired with OpenTelemetry—a CNCF-standardized observability framework—enables organizations to collect, analyze, and act upon telemetry data including traces, metrics, and logs. This detailed article provides an in-depth exploration of how to architect a practical observability solution with Azure Monitor and OpenTelemetry, highlighting best practices and real-world scenarios for intermediate to advanced developers and DevOps professionals.
Understanding Observability and Its Critical Role
Observability transcends traditional monitoring by providing insights into an application’s internal state through telemetry data. It empowers teams to diagnose issues, optimize performance, and understand user experience in a holistic manner. Azure Monitor offers a powerful platform to ingest and analyze telemetry, while OpenTelemetry provides vendor-neutral instrumentation allowing seamless integration and data consistency.
What is OpenTelemetry and Why Use It with Azure Monitor?
OpenTelemetry (OTel) is an open-source project that standardizes the collection of distributed traces, metrics, and logs. Its semantic conventions ensure telemetry data across diverse environments and languages remain consistent, enabling unified analysis.
Azure Monitor now supports ingestion of OpenTelemetry Protocol (OTLP) signals in a limited preview, enhancing the extensibility and flexibility of monitoring solutions. Leveraging OTel with Azure Monitor combines the power of an industry-standard instrumentation framework with Azure’s scalable analytics and visualization capabilities.
Core Capabilities of Azure Monitor with OpenTelemetry
Azure Monitor ingestion pipeline now supports:
- Traces, metrics, and logs ingestion using Application Insights and Azure Monitor Agent (AMA).
- Seamless export from OpenTelemetry Collector to Azure Monitor ingestion endpoints.
- Exploration and troubleshooting through Application Insights experiences like Performance and Failures blades.
- Visualization of Prometheus metrics with Dashboards in Grafana integrated into the Azure portal.
- Advanced querying and correlation using Kusto Query Language (KQL) in Log Analytics with OpenTelemetry semantic conventions.
Choosing the Right Onboarding Path
Your observability strategy depends on where workloads run. Azure Monitor offers tailored onboarding paths:
1. Monitoring Applications on Azure Kubernetes Service (AKS)
For containerized workloads in AKS, enable monitoring by:
- Activating the AKS integration in the cluster’s Monitor settings, which injects required Azure Monitor components.
- Creating or selecting an Application Insights resource with “Enable OTLP Support (Preview)” and “Use managed workspaces” set to Yes.
- Onboarding applications per namespace or deployment using:
- Autoinstrumentation for Java and Node.js applications.
- Autoconfiguration for apps already instrumented with OpenTelemetry SDKs.
This path simplifies telemetry collection with minimal manual setup, leveraging native Kubernetes integration.
2. Configuring Other Environments (VMs, On-Premises, Cloud)
For workloads outside AKS, use either:
- Azure Monitor Agent (AMA) with Data Collection Rules and Endpoints to ingest OTLP signals.
- OpenTelemetry Collector configured to export telemetry directly to Azure Monitor ingestion endpoints.
You can orchestrate ingestion automatically by creating an Application Insights resource, which sets up necessary workspaces and OTLP endpoints, or manage these components manually for fine-grained control.
Example OpenTelemetry Collector configuration snippet:
exporters:
azuremonitor:
instrumentation_key: "<YOUR_INSTRUMENTATION_KEY>"
# Alternatively, use Azure AD authentication via the Azure Auth extension
service:
pipelines:
traces:
receivers: [otlp]
exporters: [azuremonitor]
metrics:
receivers: [otlp]
exporters: [azuremonitor]
logs:
receivers: [otlp]
exporters: [azuremonitor]
Leveraging Azure Monitor Experiences for Observability
Once onboarded, Azure Monitor offers comprehensive tools to investigate and visualize telemetry.
Application Insights: Troubleshooting & Diagnostics
- Analyze distributed traces end-to-end, correlating requests, dependencies, and failures.
- Use blades like Performance, Failures, Search, and Transaction details to dive deep into application behavior.
- For agent-based telemetry, the Agents details (Preview) view helps monitor AI agents emitting OpenTelemetry data.
Dashboards with Grafana: Visualizing Prometheus Metrics
- Utilize Azure-managed Grafana dashboards tailored for OpenTelemetry and common application scenarios.
- Customize, save, and manage dashboards as Azure resources with RBAC controls.
- Perform ad-hoc queries with Grafana Explore to complement Application Insights data.
Example: Creating a Prometheus query in Grafana for a service latency metric:
histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))
Log Analytics: Powerful Querying with OpenTelemetry Semantic Conventions
- Use Kusto Query Language (KQL) to query logs and traces stored using OpenTelemetry semantic conventions.
- Join metrics, logs, and traces for multi-dimensional analysis.
Example KQL query to identify failed HTTP requests with latency over 1 second:
requests
| where success == false and duration > 1s
| project timestamp, name, resultCode, duration, cloud_RoleName
| order by timestamp desc
Best Practices for Implementing Your Observability Strategy
- Standardize instrumentation using OpenTelemetry SDKs across services for consistent telemetry.
- Autoinstrument where possible to reduce manual overhead and human error.
- Leverage managed workspaces in Application Insights for simplified resource management.
- Use Data Collection Rules and Endpoints to control and route telemetry efficiently.
- Secure telemetry data by using managed identities and Azure AD authentication.
- Customize Grafana dashboards to reflect key business and application metrics.
- Regularly review telemetry data for anomalies and to optimize performance proactively.
Real-World Scenario: Monitoring a Microservices Application on AKS
Imagine a retail application deployed on AKS composed of multiple microservices written in Java and Node.js. To establish observability:
- Enable AKS integration with Azure Monitor.
- Create an Application Insights instance with OTLP support.
- Use autoinstrumentation for Java and Node.js services to automatically emit traces, metrics, and logs.
- Visualize service latency and error rates in Grafana dashboards.
- Use Application Insights to trace customer transactions end-to-end, correlating failures to specific microservices.
- Query logs in Log Analytics using KQL to troubleshoot incidents rapidly.
This approach minimizes setup complexity and provides comprehensive visibility into application health and performance.
Limitations and Considerations
- The OTLP ingestion feature is currently in limited preview; production use is not recommended.
- Supported protocols include OTLP over HTTP/protobuf; OTLP/gRPC and JSON payloads are not supported yet.
- Some AKS node pools and networking scenarios, like Istio mTLS, have limited support.
- Live Metrics is not available with the OpenTelemetry ingestion path at this time.
Conclusion
Integrating Azure Monitor with OpenTelemetry offers a modern, extensible observability strategy for cloud-native and hybrid environments. By leveraging standardized telemetry data and Azure’s powerful analytics and visualization tools, organizations can achieve end-to-end visibility, rapid troubleshooting, and data-driven performance optimization.
Adopting best practices such as autoinstrumentation, managed workspaces, and secure data ingestion will ensure a scalable and maintainable observability infrastructure.
For further learning and updates, explore the official OpenTelemetry documentation and Azure Monitor OpenTelemetry integration guides.
Author: Joseph Perez