When building a software system of any complexity, it is useful to collect information about the use and performance of that system. Azure Monitor provides the ability to capture and persist metrics and logs. We can later review this data using reports or graphics, which helps us determine if there are any issues, allowing us to correct those issues.
However, this requires us to check these reports, which involves a delay. Some events require more immediate attention. Fortunately, Azure Monitor provides the ability to create Alerts to do this. An Alert will perform an action based on a specified condition, as shown in Fig. 1.
The signal can be any metric collected by Azure Monitor, such as CPU usage, memory usage, or response time.
Typically, that condition will be a metric that falls outside an acceptable boundary. For example, we may wish to know when a web application's CPU usage exceeds 50% of capacity.
An Action can be a notification, such as an email, an SMS message, or a phone call. In addition, we can tell Azure to send a message to another system, such as an Azure Function, an Event Hub, or a Logic App. By sending a message to another system, we can configure a more complex workflow to respond to the alert.
An Action Group defines what actions to perform and who or what to notify.
Alerts are useful to notify us of a problem, so we can quickly know about it and correct it. But alerts can also let us know before a problem occurs. Low disc space may not cause a problem yet, but knowing about it helps us correct it before it becomes a problem.
It helps to label the severity of an issue when sending an alert. Consider the impact of an issue (how many people or systems are affected) and the urgency (how soon we need to fix it) when determining the severity. High-urgency/high-impact issues take top priority, while low-impact/low-urgency issues may require no action and should not be a candidate for alerts. Fig. 2 illustrates this matrix.
This article discusses the importance of Alerts and how to use them. In the following articles, I will show how to define an Action Group and an Azure Monitor Alert so that you can implement Azure Monitor Alerts.