1. Overview #
Azure Monitor and its data stores.
A single platform: Azure Monitor #
On Azure, all observability goes through Azure Monitor. It relies on two main stores: Azure Monitor Metrics (lightweight time series, kept 93 days) and Azure Monitor logs stored in Log Analytics workspaces and queried with KQL (Kusto Query Language). Application Insights provides APM and stores its data (requests, dependencies, traces, exceptions) in Log Analytics. For Kubernetes and Prometheus metrics, Azure offers Azure Monitor managed service for Prometheus and Azure Managed Grafana.
Supported pillars #
| Pillar | Azure component | Exploration | OpenTelemetry |
|---|---|---|---|
| Metrics | Azure Monitor Metrics, Managed Prometheus | Metrics Explorer, PromQL | ✅ Yes |
| Logs | Log Analytics (tables, Analytics, Basic, Auxiliary plans) | KQL, Logs, Workbooks | ✅ Yes |
| Traces | Application Insights (AppRequests, AppDependencies tables) | Transaction search, application map | ✅ Yes (Azure Monitor OpenTelemetry distro) |
| Profiles | Application Insights Profiler (.NET, Java) | Per-request profiling traces | 🟡 Partial (Azure-specific Profiler) |
| RUM and synthetic | Application Insights (browser SDK), standard availability tests | User experience, web tests | 🟡 Partial |
| Events and audit | Activity log, Change Analysis | KQL, Azure Resource Graph | ❌ No |
Good to know: The Application Insights Snapshot Debugger captures variable state at the moment of an exception in production (.NET): a useful complement to profiles.
2. The components in detail #
Role of each Azure Monitor building block.
Platform metrics and diagnostic settings #
Every Azure resource publishes its platform metrics for free. Resource logs (application gateway requests, database audit logs, etc.) are only collected if you create a diagnostic setting that sends them to Log Analytics, a storage account, Event Hubs or a partner solution. The activity log records management operations (creation, deletion, configuration changes).
az monitor diagnostic-settings create --name vers-law \
--resource /subscriptions/<abonnement>/resourceGroups/rg-prod/providers/Microsoft.Web/sites/api-boutique \
--workspace /subscriptions/<abonnement>/resourceGroups/rg-obs/providers/Microsoft.OperationalInsights/workspaces/law-prod \
--logs '[{"category":"AppServiceHTTPLogs","enabled":true}]' --metrics '[{"category":"AllMetrics","enabled":true}]'Log Analytics and KQL #
A Log Analytics workspace contains tables (Syslog, Perf, ContainerLogV2, AppRequests…). Each table can use the Analytics plan (full queries, alerts), Basic or Auxiliary (cheaper, limited queries) depending on usage. Interactive retention and long-term archiving are set per table.
AppRequests
| where TimeGenerated > ago(1h)
| summarize requetes = count(), erreurs = countif(Success == false),
p95 = percentile(DurationMs, 95) by bin(TimeGenerated, 5m), Name
| order by TimeGenerated descAzure Monitor Agent and data collection rules (DCR) #
The Azure Monitor Agent (AMA) replaces the legacy Log Analytics agents (MMA/OMS). It collects system logs, performance counters and text files on Windows and Linux VMs, including outside Azure through Azure Arc. What it collects and where it sends it is described in data collection rules (DCR), which can also filter and transform data in KQL before ingestion to reduce costs.
Application Insights #
Application Insights is the APM building block: incoming requests, outgoing dependencies, exceptions, traces, application map, failure and performance analysis, end-to-end transaction search, live metrics, availability tests and user experience (JavaScript SDK). An Application Insights resource is attached to a Log Analytics workspace.
Kubernetes: Container Insights, managed Prometheus and Grafana #
On AKS, Container Insights collects container logs and inventory, while Managed Prometheus collects metrics (default targets, ServiceMonitor and PodMonitor) into an Azure Monitor workspace. Azure Managed Grafana connects to it with ready-to-use dashboards.
az aks update --resource-group rg-prod --name aks-prod \
--enable-azure-monitor-metrics \
--azure-monitor-workspace-resource-id <id-espace-azure-monitor> \
--grafana-resource-id <id-grafana-manage>Alerts, action groups and workbooks #
| Type | Use |
|---|---|
| Metric alerts | Static or dynamic thresholds on metrics, evaluated every minute |
| Log search alerts | Scheduled KQL query; ideal for complex conditions |
| Prometheus alerts | PromQL rule groups on the Azure Monitor workspace |
| Activity log and Service Health alerts | Management operations and Azure platform incidents |
| Action groups | Notifications (email, SMS, app) and actions (webhook, Logic Apps, Functions, ITSM) |
| Workbooks | Interactive reports combining metrics, KQL and parameters |
3. Detailed sheet for each component #
Role, content, data types, retention and internal and external interactions of each building block in the diagram.
Summary view #
The following table summarizes each component of the architecture diagram; the sheets that follow detail them one by one.
| Component | Zone | Signals | Can be opened to the outside |
|---|---|---|---|
| Diagnostic settings | Collection | Resource logs, metrics | 🔒 No (internal) |
| AMA + DCR rules | Collection | Logs, counters, metrics | 🔒 No (internal) |
| Azure Monitor Metrics | Storage | Metrics | 🟡 Indirectly |
| Managed Prometheus | Storage | Prometheus metrics | 🟡 Indirectly |
| Log Analytics | Storage | Logs, traces, events | 🟡 Indirectly |
| Application Insights | APM | Traces, requests, exceptions, profiles | 🟡 Indirectly |
| Managed Grafana | Output | Visualization | 🟠 Yes |
| Query APIs | Output | All | 🟠 Yes |
| Alerts and action groups | Output | Events | 🟠 Yes |
| Event Hubs | Output | Streamed logs and metrics | 🟠 Yes |
Indicative values: Retention periods, limits and pricing models change regularly: check them in the official documentation before sizing an architecture.
Diagnostic settings #
The mechanism that enables collection of an Azure service's resource logs and chooses their destination.
| Characteristic | Detail |
|---|---|
| Role | Route resource logs, platform metrics and the activity log to one or more destinations. |
| Content | Up to 5 settings per resource; choice of log categories (or allLogs, audit groups) and metrics (AllMetrics). |
| Data type | Resource logs (requests, audits, errors), platform metrics, subscription activity log. |
| Storage and retention | None: routing only. |
| Inputs (internal components) | Azure resources (App Service, Key Vault, SQL, Application Gateway…). |
| Outputs (internal components) | Log Analytics, storage account, Event Hubs, partner solutions. |
| External interactions | Through Event Hubs or native ISV services (Datadog, Elastic, Dynatrace, New Relic). |
| Can be opened to the outside | 🔒 No (internal): it feeds components that can be opened but exposes nothing itself. |
| Security and access | Monitoring Contributor role; deployment at scale with Azure Policy (DeployIfNotExists). |
| Cost | Free; you pay for ingestion at the destination. |
Azure Monitor Agent (AMA) and data collection rules (DCR) #
Azure Monitor's single collection agent, driven by data collection rules.
| Characteristic | Detail |
|---|---|
| Role | Collect logs and counters from virtual machines and servers, filter and transform before ingestion. |
| Content | DCR rules: sources (performance counters, Syslog, Windows events, text and JSON files, IIS), destinations, KQL transformations; DCE endpoints; logs ingestion API for applications. |
| Data type | System and application logs, performance counters, guest metrics; Prometheus metrics on AKS (ama-metrics add-on). |
| Storage and retention | None: local buffer. |
| Inputs (internal components) | Azure VMs, scale sets, on-premises or other cloud servers through Azure Arc, AKS clusters. |
| Outputs (internal components) | Log Analytics, Azure Monitor Metrics, Managed Prometheus (Azure Monitor workspace). |
| External interactions | None directly: go through Event Hubs or the APIs. |
| Can be opened to the outside | 🔒 No (internal) |
| Security and access | Machine managed identity; DCR associations through Azure Policy. |
| Cost | Free; ingestion billed at the destination (reduced by transformations). |
Azure Monitor Metrics #
Azure Monitor's lightweight and fast metrics store.
| Characteristic | Detail |
|---|---|
| Role | Store numeric metrics for all resources and feed alerts, autoscaling and dashboards. |
| Content | Platform metrics (automatic), guest and custom metrics; dimensions; Metrics Explorer. |
| Data type | Time series, one-minute granularity. |
| Storage and retention | Kept 93 days. |
| Inputs (internal components) | Azure resources (automatic), AMA, Application Insights (custom metrics). |
| Outputs (internal components) | Metric alerts, autoscaling, Managed Grafana, diagnostic settings (export to Log Analytics, storage, Event Hubs). |
| External interactions | Read by Grafana, Datadog, Dynatrace through the Metrics REST API. |
| Can be opened to the outside | 🟡 Indirectly: through the REST API and diagnostic settings export. |
| Security and access | Azure RBAC (Monitoring Reader); managed identities for tools. |
| Cost | Platform metrics free; custom metrics and API calls billed. |
Azure Monitor managed service for Prometheus #
Azure's managed Prometheus service, backed by an Azure Monitor workspace.
| Characteristic | Detail |
|---|---|
| Role | Store and query Prometheus metrics in PromQL, especially those of AKS and Azure Arc-enabled Kubernetes. |
| Content | Azure Monitor workspace, Prometheus rule groups (recording and alerting), PromQL query endpoint. |
| Data type | Prometheus time series. |
| Storage and retention | Kept 18 months. |
| Inputs (internal components) | AKS ama-metrics add-on (default targets, ServiceMonitor, PodMonitor), remote write from Prometheus or a collector. |
| Outputs (internal components) | Managed Grafana, Prometheus alerts to action groups. |
| External interactions | Any PromQL-compatible tool (self-hosted Grafana, KEDA) through the query endpoint. |
| Can be opened to the outside | 🟡 Indirectly: through its PromQL API. |
| Security and access | Entra ID (managed identity or service principal) with the Monitoring Data Reader role. |
| Cost | Samples ingested and queried. |
Log Analytics #
The heart of Azure Monitor logs: a workspace containing tables queried in KQL.
| Characteristic | Detail |
|---|---|
| Role | Store and analyze logs, traces, events and security data; serve as the foundation of Application Insights and Microsoft Sentinel. |
| Content | Tables (Syslog, Perf, Event, ContainerLogV2, AzureDiagnostics, Application Insights App* tables, custom tables), KQL queries, workbooks, functions. |
| Data type | Column-structured records (logs, traces, guest metrics, events). |
| Storage and retention | Interactive retention of 30 days by default (up to 2 years) and total retention up to 12 years; Analytics, Basic and Auxiliary table plans. |
| Inputs (internal components) | Diagnostic settings, AMA and DCR, Application Insights, logs ingestion API. |
| Outputs (internal components) | Log search alerts, workbooks, Managed Grafana, data export rules. |
| External interactions | Export rules to Event Hubs or storage; queries through the Log Analytics API from Grafana or a SIEM. |
| Can be opened to the outside | 🟡 Indirectly: through the query API and export rules. |
| Security and access | RBAC at workspace, table or resource level (resource context); private links. |
| Cost | Ingestion per GB depending on the table plan, retention beyond the included period, queries on Basic and Auxiliary plans. |
Application Insights #
Azure Monitor's APM building block.
| Characteristic | Detail |
|---|---|
| Role | Track application performance and reliability: requests, dependencies, exceptions, availability, user experience. |
| Content | Application map, transaction search, failure and performance analysis, live metrics, availability tests, Profiler, Snapshot Debugger. |
| Data type | Requests, dependencies, exceptions, traces, page views, custom metrics, availability results. |
| Storage and retention | In the associated Log Analytics workspace (AppRequests, AppDependencies, AppExceptions… tables), according to its retention. |
| Inputs (internal components) | Azure Monitor OpenTelemetry distro, Java agent, JavaScript SDK, App Service auto-instrumentation. |
| Outputs (internal components) | Log Analytics, Azure Monitor Metrics (standard metrics), alerts. |
| External interactions | OpenTelemetry data can be duplicated to a third-party APM by the collector. |
| Can be opened to the outside | 🟡 Indirectly: through the Log Analytics API. |
| Security and access | Connection string; Entra ID authentication of ingestion available; RBAC. |
| Cost | Same as Log Analytics (ingestion); sampling reduces volume. |
Azure Managed Grafana #
A Grafana instance managed by Microsoft, integrated with Entra ID.
| Characteristic | Detail |
|---|---|
| Role | Visualize metrics, logs and traces from several sources in shared dashboards. |
| Content | Ready-to-use dashboards for Azure and AKS, Azure Monitor, Prometheus, Azure Data Explorer data sources and plugins. |
| Data type | Stores no telemetry. |
| Storage and retention | Dashboards and configuration. |
| Inputs (internal components) | Azure Monitor Metrics, Managed Prometheus, Log Analytics, Application Insights. |
| Outputs (internal components) | Grafana alerts and notifications. |
| External interactions | Can query sources outside Azure (Prometheus, Loki, Datadog) through plugins. |
| Can be opened to the outside | 🟠 Yes: web interface and Grafana API, with public access or a private endpoint. |
| Security and access | Entra ID, Grafana Admin, Editor, Viewer roles; managed identity to read data. |
| Cost | Per instance and per active user (Standard tier). |
Query APIs (Azure Monitor, Log Analytics, Prometheus) #
The endpoints that expose Azure Monitor data for reading.
| Characteristic | Detail |
|---|---|
| Role | Let tools, scripts and dashboards query metrics and logs. |
| Content | Azure Monitor Metrics REST API, Log Analytics query API (KQL), Azure Monitor workspace Prometheus HTTP API, Azure Resource Graph; Azure Monitor Query libraries. |
| Data type | JSON responses. |
| Inputs (internal components) | Azure Monitor Metrics, Log Analytics, Managed Prometheus. |
| Outputs (internal components) | Managed Grafana and any authorized client. |
| External interactions | Self-hosted or Cloud Grafana, SIEM, third-party observability tools, scripts. |
| Can be opened to the outside | 🟠 Yes: public or private endpoints (Azure Monitor Private Link Scope). |
| Security and access | Entra ID token (service principal or managed identity); read RBAC. |
| Cost | Free for most queries; billed on Basic and Auxiliary tables. |
Alerts and action groups #
Azure Monitor's alerting engine and its notification and action channels.
| Characteristic | Detail |
|---|---|
| Role | Detect conditions in the data and notify or act automatically. |
| Content | Metric alerts (static or dynamic thresholds), log search alerts (KQL), Prometheus, activity log and Service Health alerts; alert processing rules; common alert schema. |
| Data type | Alert instances (fired, resolved) in the common JSON schema. |
| Inputs (internal components) | Azure Monitor Metrics, Log Analytics, Managed Prometheus, activity log. |
| Outputs (internal components) | Action groups: Automation runbooks, Logic Apps, Azure Functions. |
| External interactions | Email, SMS, voice and mobile notifications, webhooks, ITSM connectors (ServiceNow), PagerDuty, Teams. |
| Can be opened to the outside | 🟠 Yes: outgoing webhooks and notifications. |
| Security and access | Monitoring Contributor role; secure webhooks (Entra ID authentication available). |
| Cost | Per alert rule and per notification (SMS, calls). |
Azure Event Hubs #
Azure's streaming platform, used as a telemetry export gateway.
| Characteristic | Detail |
|---|---|
| Role | Continuously receive logs and metrics from Azure Monitor and make them available to external consumers. |
| Content | Namespace, event hubs, partitions, consumer groups; AMQP protocol and Apache Kafka compatibility. |
| Data type | JSON events (diagnostic settings records, Log Analytics exports). |
| Storage and retention | Retention of 1 to 7 days (Standard), up to 90 days (Premium, Dedicated); optional capture to storage. |
| Inputs (internal components) | Diagnostic settings, Log Analytics export rules, activity log. |
| Outputs (internal components) | Azure Functions, Stream Analytics, storage (Capture). |
| External interactions | Splunk (add-on), Elastic Agent and Logstash, Datadog (forwarder function), Sumo Logic, IBM QRadar, Kafka consumers. |
| Can be opened to the outside | 🟠 Yes: it is the main continuous export channel to the outside. |
| Security and access | Shared access signatures (SAS) or Entra ID; private endpoints and firewall rules. |
| Cost | Throughput or processing units and event volume. |
4. OpenTelemetry compatibility #
Azure Monitor OpenTelemetry distro and collector.
Instrumenting with the Azure Monitor OpenTelemetry distro #
Microsoft now recommends OpenTelemetry for Application Insights: the Azure Monitor OpenTelemetry distro (.NET, Java, Node.js, Python) bundles the SDK, automatic instrumentation of common libraries and the Azure Monitor exporter. OpenTelemetry traces, metrics and logs become requests, dependencies, traces and custom metrics in Application Insights.
pip install azure-monitor-opentelemetry
# app.py
from azure.monitor.opentelemetry import configure_azure_monitor
configure_azure_monitor() # lit APPLICATIONINSIGHTS_CONNECTION_STRINGWith an OpenTelemetry Collector, the azuremonitor exporter from the contrib distribution sends traces, metrics and logs to Application Insights; metrics can also go by remote write to Managed Prometheus. Azure Monitor also offers native OTLP ingestion, currently rolling out: check its availability in your region before relying on it.
Good to know: For Java, the Application Insights 3.x agent is itself built on OpenTelemetry: it instruments without code changes and accepts the OpenTelemetry APIs for custom telemetry.
5. Interconnections with external products #
Exporting and integrating.
Sending Azure data elsewhere #
| Mechanism | Data | Destinations |
|---|---|---|
| Diagnostic settings to Event Hubs | Resource logs, metrics, activity log | Splunk, Elastic, Datadog, IBM QRadar, Sumo Logic |
| Native Azure ISV services | Metrics and logs through native integration | Datadog, Dynatrace, New Relic, Elastic Cloud, Grafana |
| Log Analytics export rules | Log Analytics tables, continuously | Storage account, Event Hubs |
| Microsoft Sentinel | Security logs in Log Analytics | SIEM, detection and response |
| Grafana | Azure Monitor plugin (Metrics, Logs, Traces, Resource Graph) | Grafana Cloud or self-hosted |
Good practice: For a third-party tool, go through Event Hubs rather than polling the APIs: the stream is continuous, scalable and independent of the number of resources.
6. Costs and best practices #
Controlling ingestion.
Best practices #
- Centralize logs in few Log Analytics workspaces (per environment or per region), with resource-context access control.
- Choose the right table plan (Analytics, Basic, Auxiliary) and filter with DCR transformations.
- Deploy diagnostic settings and DCR rules with Azure Policy to automatically cover new resources.
- Instrument with the OpenTelemetry distro to stay portable.
- Sample Application Insights telemetry on high-traffic applications.
- Set a daily cap and cost alerts on ingestion.
Common mistake: Collecting « all logs » from every resource in the Analytics plan makes the bill explode: start with the useful categories.
