Configuring Telemetry Collection
This lesson explains how to enable monitoring at each layer of a system.
Learning outcomes
After completing this lesson, you will be able to:
- Choose how to instrument an application.
- Explain what VM insights needs.
- Describe Container insights.
- Identify which features need no configuration.
Application Insights
Azure Monitor Application Insights is the application performance monitoring feature of Azure Monitor. It records requests, dependencies, exceptions, traces and custom events, and stores them in a Log Analytics workspace. An application connects through a connection string.
Instrumentation depends on the application. For most server-side code, Microsoft recommends the Azure Monitor OpenTelemetry Distro, available for .NET, Java, Node.js and Python. Browser applications use the JavaScript SDK. App Service supports autoinstrumentation through an application setting, which needs no code change. In Azure Functions, OpenTelemetry output is set with telemetryMode in host.json.
# Python: enable the Azure Monitor OpenTelemetry Distro
from azure.monitor.opentelemetry import configure_azure_monitor
configure_azure_monitor(
connection_string="InstrumentationKey=...;IngestionEndpoint=..."
)A pipeline should supply the connection string as a setting for each environment, so that test and production report separately. A sampling setting reduces volume and cost. Availability tests check a URL from several Azure locations, which detects an outage even with no user traffic.
Instrumenting applications
VM insights
VM insights monitors virtual machines and Arc-enabled servers. Host metrics are collected by default, at no cost, but they do not see inside the guest, so memory and logical disk data need the Azure Monitor Agent. Enabling enhanced monitoring installs this agent with a data collection rule. Microsoft recommends OpenTelemetry metrics for new deployments, and logs-based metrics remain the classic option.
The Map feature and the Dependency agent are deprecated and retire on 30 June 2028, so they should not be selected for new work. An enablement policy can apply monitoring at scale.
The following diagram shows where each kind of VM data is collected, which explains why a dashboard has CPU but no memory.

VM insights
Container insights
Container insights collects logs and inventory from Kubernetes clusters, including AKS and Arc-enabled clusters. It works with Azure Monitor managed service for Prometheus, which collects metrics, and Azure Managed Grafana, which displays them. Control plane logs are collected through a diagnostic setting, and Application Insights covers the application layer.
az aks enable-addons --addons monitoring \
--name aks-prod --resource-group rg-aks \
--workspace-resource-id "$WORKSPACE_ID"
az aks update --name aks-prod --resource-group rg-aks \
--enable-azure-monitor-metricsMonitoring an AKS cluster
Azure Monitor for Storage and Networks
The skills measured use older names for two features. Azure Monitor for Storage is now Storage insights, and Azure Monitor for Networks is now Network Insights. These are prebuilt views over platform data, so they need no agent and no configuration.
Storage insights
Storage insights shows availability, transactions, latency and capacity across storage accounts, by blob, file, table and queue. It is opened from Azure Monitor, or from a storage account. The multi-account view supports up to 200 accounts, and the feature has no charge.
Network Insights
Network Insights shows the topology of network resources, their health and metrics, connectivity from Connection Monitor tests, and traffic from flow logs and Traffic Analytics. Its diagnostic toolkit gives access to packet capture, next hop and IP flow verify.
Storage insights and Network Insights
Choosing a feature
The following table recaps which feature to use at each layer, and whether setup is needed.
| Layer | Feature | Setup |
|---|---|---|
| Application code | Application Insights | OpenTelemetry Distro, SDK or autoinstrumentation |
| Virtual machines | VM insights | Azure Monitor Agent and data collection rule |
| Kubernetes | Container insights and Managed Prometheus | Add-on or monitoring profile |
| Storage accounts | Storage insights | None |
| Networks | Network Insights | None for the views; flow logs for traffic |
Missing memory data
A team's dashboard shows CPU for an Azure virtual machine, but no memory metrics. The application is healthy. Why is memory missing, and how can it be added?
Azure host metrics do not see inside the guest, so available memory is not among the default metrics. The team should enable VM insights or enhanced monitoring, which installs the Azure Monitor Agent with a data collection rule. A diagnostic setting on the virtual machine does not collect guest performance data. Application Insights tracks the application, and not the operating system's memory.
Which instrumentation does a browser application use?
Show answer
The Application Insights JavaScript SDK. OpenTelemetry is the recommended route for server-side code.
Exam Tips
Remember for the exam
- The Azure Monitor OpenTelemetry Distro is recommended for server-side code.
- Guest memory needs the Azure Monitor Agent.
- Container insights works with Managed Prometheus and Grafana.
- Storage insights and Network Insights need no agent.
- Do not choose the Dependency agent or Map for new work.