Lesson 1 of 5 Monitoring a DevOps Environment

Understanding Azure Monitor

This lesson explains data types, collection and alerting in Azure Monitor.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe metrics, logs, traces and changes.
  • Identify how each source is collected.
  • Distinguish the types of alert.
  • Describe action groups and alert processing rules.

What Azure Monitor collects

Azure Monitor gathers telemetry from Azure resources, applications and hybrid machines. Its data falls into a few types, and each one answers a different question.

Metrics

Metrics are numbers recorded over time, such as CPU percentage. They are light and fast, so they suit dashboards and near-real-time alerts. Platform metrics are collected automatically for most resources, with no setup.

Logs

Logs are records with many fields, such as a request with its URL, duration and result. They are stored in a Log Analytics workspace, and queried with Kusto Query Language (KQL). They suit investigation and correlation.

Traces

Distributed traces follow a request across services, and are explained in a later lesson.

Changes

Change data records what changed on resources, which helps when a problem begins shortly after a change.

The following diagram checks each Azure Monitor data source against the question of who deleted a storage account.

Which Azure Monitor data shows who deleted a storage account when nothing was configured. The activity log records control plane operations automatically for 90 days. Resource logs need a diagnostic setting, metrics hold numbers but not callers, and Application Insights has no management operations.
No monitoring had been configured.
Sort into groups

Metric, log or trace?

Exam skills 5.1.1

Decide which type of Azure Monitor data each item is.

Log in to try this activity Interactive activities are free with an account.

How data arrives

Different sources need different collection. The following table shows the main ones. Note that some collection is automatic, and some requires configuration, which is a common exam distinction.

SourceExamplesHow it is collected
Azure platformHost CPU, storage transactionsAutomatic metrics
Control planeWho stopped a virtual machineAutomatic activity log, kept for 90 days
Inside a resourceKey Vault reads, SQL auditResource logs, through a diagnostic setting
Guest operating systemMemory, disk, syslogAzure Monitor Agent with a data collection rule
ApplicationRequests, exceptionsApplication Insights
KubernetesPods, nodesContainer insights and Managed Prometheus

A diagnostic setting routes resource logs and metrics to a workspace, a storage account, an event hub or a partner solution. A data collection rule tells the Azure Monitor Agent what to gather, and where to send it. The older Log Analytics agent was retired in August 2024, and must not be selected for new work.

Sort into groups

Automatic or configured?

Exam skills 5.1.1 · 5.1.2

Decide whether each kind of data is collected automatically or needs configuration.

Log in to try this activity Interactive activities are free with an account.

Alerts and actions

An alert rule watches for a condition, and it fires when the condition is met. There are three main types. A metric alert suits a numeric threshold, and it evaluates quickly. A log search alert runs a KQL query on a schedule, which suits complex conditions. An activity log alert reacts to control plane or Service Health events.

An action group is a reusable list of notifications and actions, such as email, an SMS message, a webhook, an Azure Function or a logic app. Alert processing rules can suppress notifications during planned maintenance, without changing alert rules. A deployment pipeline can apply such a rule during a release, to avoid false alarms.

Scenario questions

Alert rules and action groups

Exam skills 5.1.1

Choose the alert component that meets each need.

Log in to try this activity Interactive activities are free with an account.

Presenting data

Azure Monitor workbooks combine text, queries and charts into interactive reports. Azure dashboards pin charts in a shared view. Azure Managed Grafana and Azure Monitor dashboards with Grafana suit teams that use Grafana, and Power BI suits business reporting. Insights are prebuilt views for specific services, such as VM insights, which the next lesson describes.

Match the pairs

Ways to present monitoring data

Exam skills 5.1.1

Match each presentation option with what it suits.

Log in to try this activity Interactive activities are free with an account.
Worked example

Finding the right data

Someone deleted a storage account last week, and a team must discover who did it. No monitoring was configured. Where can they look?

The activity log records control plane operations automatically, for 90 days, so it shows who deleted the account. Resource logs need a diagnostic setting, which did not exist. Metrics hold numbers and not callers. Application Insights tracks application telemetry, and it has no record of management operations.

Check yourself

Which alert type suits a complex condition that spans several tables?

Show answer

A log search alert, which runs a KQL query on a schedule.

Exam Tips

Remember for the exam

  • Metrics are numbers over time; logs are detailed records queried with KQL.
  • The activity log is automatic, and kept for 90 days.
  • Resource logs need a diagnostic setting.
  • Guest data needs the Azure Monitor Agent and a data collection rule.
  • Action groups define notifications and actions; alert processing rules suppress them.