-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Implementing Microsoft Azure Architect Technologies: AZ-303 Exam Prep and Beyond
By :

To analyze alerts and metrics across Azure Monitor, we need to go to the monitoring resource inside the Azure portal. In the upcoming sections, we will set up metrics and alerts and show you how to analyze them.
Metrics describe an aspect of a system at a particular point in time and are displayed in numerical values. They are collected at regular intervals and are identified with a timestamp, a name, a value, and one or more defining labels. They are capable of supporting near real-time scenarios and are useful for alerting. Alerts can be fired quickly with relatively simple logic.
Metrics in Azure Monitor are stored in a time-series database that is optimized for analyzing timestamped data. This makes metrics suited for the fast detection of issues. They can help to detect how your service or system is performing, but to get the overall picture, they typically need to be combined with logs to identify the root cause of issues.
You can use metrics for the following scenarios:
There are four main sources of metrics that are collected by Azure Monitor. Once they are collected and stored in the Azure Monitor Metric database, they can be evaluated together regardless of their source:
Tip
For more information about the InfluxData Telegraf agent, go to the InfluxData website, https://www.influxdata.com/time-series-platform/telegraf/.
Metrics data often has limited information to provide context for collected values. This challenge is addressed by Azure Monitor using multi-dimensional metrics. The dimensions of the metrics are name-value pairs that store additional data that describe the metric value. For example, a metric called available disk space could have a dimension called Drive with the values C: and D: stored inside. This value would allow the viewing of available disk space across all drives, or each drive individually.
In the next section, we are going to create a metric in the Azure portal.
To display the metrics for a Windows VM (if you followed the creating a VM walk-through detailed in the Technical requirements section) in Azure Monitor, follow these steps:
Figure 1.2 – Selecting the resources
Figure 1.3 – Metric type
Tip
Take some time to look at the different metrics that you can choose from. This may be a part of the exam questions.
Figure 1.4 – Time ranges
Figure 1.5 – Pinning a metric to a dashboard
Important note
Metrics are also available directly from the Azure resource blades. So, for instance, if you have a VM, go to the VM resource by selecting it. Then, in the left-hand menu, under Monitoring, you can select Metrics.
In the next section, we’re going to look at how to set up and analyze alerts in Azure Monitor.
Alerts
With alerts, Azure can proactively notify you when critical conditions occur in the Azure or on-premises environment. Alerts can also attempt to take corrective actions automatically. Alert rules that are based on metrics will provide near real-time alerting, based on the metric. Alerts that are created based on logs can merge data from different resources.
The alerts in Azure Monitor use action groups, which are unique sets of recipients and actions that can be shared across multiple rules. These action groups can use webhooks to start external actions, based on the requirements that are set up for this alert. These external actions can then be picked up by different Azure resources, such as Runbooks, Functions, or Logic Apps. Webhooks can also be used to add these alerts to external IT Service Management (ITSM) tools.
You can also set alerts for all of the different Azure resources. In the following sections, we are going to create an alert.
To create an alert, follow these steps:
Figure 1.6 – Creating a new alert
Figure 1.7 – Creating a new rule
Figure 1.8 – Filtering by subscription and resource type
Figure 1.9 – Filtering on a signal
a) Threshold: Static (in the next section, we are going to cover the difference between static and dynamic thresholds)
b) Operator: Greater than
c) Aggregation type: Average
d) Threshold Value: 90%
Figure 1.10 – Setting condition values
a) Action group name: Type Send email
.
b) Short name: Type email
.
c) Subscription: Select the subscription where the VM is created.
d) Resource group: Select Default-ActivityLogAlerts (to be created).
a) Action name: email
b) Action type: Email/SMS/Push/Voice
Figure 1.11 – Creating an action group
Figure 1.12 – Alert settings
We have now created an alert and an action group that will alert a user via email when the CPU goes over 90%. In the next section, we’re going to create a baseline for resources.