Azure Monitor, Log Analytics and Application Insights
Azure Monitor
Azure Monitor is a platform that collects, analyses and acts on data from your resources: Azure resources, on-premises machines and even other clouds. It is the umbrella for monitoring in Azure.
It collects two main kinds of data:
- Metrics: numbers measured over time, such as CPU percentage or requests per second. Good for near-real-time charts and alerts.
- Logs: records of events and data, such as error messages, sign-ins and activity, which you can search and analyse.
Log Analytics
Log Analytics is the tool in the portal for writing and running queries on log data collected by Azure Monitor. Queries use the Kusto Query Language (KQL):
AzureActivity
| where TimeGenerated > ago(1d)
| summarize count() by OperationNameValueUse it to investigate problems, spot trends, and build charts and workbooks.
Azure Monitor alerts
Alerts notify you when something important happens. The main kinds are metric alerts ("CPU above 90% for 10 minutes"), log search alerts ("more than 50 failed sign-ins in an hour") and activity log alerts ("someone deleted a VM", or a Service Health event).
When an alert fires, it can trigger an action group: email or text the team, call a webhook, or run an automation that fixes the problem (for example, scaling up).
Application Insights
Azure Monitor Application Insights is the part of Azure Monitor for monitoring web applications (application performance monitoring). It works for apps in Azure, on-premises or in other clouds, through an SDK in the app or an agent, and tracks:
- request rates, response times and failure rates,
- dependency rates (calls to databases and other services),
- page views and load performance,
- exceptions and errors,
- user and session counts.
It can also run availability tests, sending requests to your app at regular intervals from around the world to check it is responding.