Skip to content

Commit de90f62

Browse files
committed
horizontal test
1 parent 4d1c17a commit de90f62

File tree

2 files changed

+158
-0
lines changed

2 files changed

+158
-0
lines changed
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
---
2+
title: Monitor App Service
3+
description: Start here to learn how to monitor your Service.
4+
ms.date: 07/08/2024
5+
ms.custom: horz-monitor
6+
ms.topic: conceptual
7+
author: AbbyMSFT
8+
ms.author: abbyweisberg
9+
ms.service: azure-monitor
10+
---
11+
12+
# Monitor App Service
13+
14+
This article describes:
15+
16+
- The types of monitoring data you can collect for this service.
17+
- Ways to analyze that data.
18+
19+
[Azure Monitor](/azure/azure-monitor/overview) collects and aggregates metrics and logs from every component of your system to monitor availability, performance, and resilience, and notify you of issues affecting your system. You can use the Azure portal, PowerShell, Azure CLI, REST API, or client libraries to set up and view monitoring data.
20+
21+
Different metrics and logs are available for different resource types. Your service can be associated with more than one resource type. This table describes how you can collect data to monitor your service, and what you can do with the data once collected:
22+
23+
|Data to collect |Description|Collection Method |Reference Information |
24+
|---------|---------|---------|---------|
25+
|Metrics |Metrics are numerical values that describe an aspect of a system at a particular point in time. Azure Monitor collects metrics at regular intervals. Metrics can be aggregated using algorithms, compared to other metrics, and analyzed for trends over time.|Collected automatically. View in metrics explorer or create a diagnostic setting to send it to other destinations.|[Supported metrics in Azure Monitor](/azure/azure-monitor/platform/metrics-supported) |
26+
|Resource logs |Logs are recorded system events. Logs can contain different types of data, be structured or free-form text, and they contain a timestamp. Azure Monitor stores structured and unstructured log data of all types in Azure Monitor Logs. You can route data to Log Analytics workspaces for querying and analysis.| You must create a diagnostic setting to collect resources logs. [Create diagnostic settings](/azure/azure-monitor/essentials/create-diagnostic-settings) |[Supported resource logs in Azure Monitor](/azure/azure-monitor/reference/supported-logs/logs-index). |
27+
|Activity log |The Azure Monitor activity log is a platform log that provides insight into subscription-level events. The activity log includes information like when a resource is modified or a virtual machine is started. |Collected automatically. View in the Azure portal or create a diagnostic setting to send it to other destinations. Can be collected in Log Analytics workspace at no charge | |
28+
29+
For information about using Azure Monitor to monitor your resources, see [Monitor Azure resources with Azure Monitor](/azure/azure-monitor/essentials/monitor-azure-resource).
30+
31+
32+
## Built in monitoring for App Service
33+
34+
- On the Azure portal page for your web app, you can select **Diagnose and solve problems** from the left navigation to access complete App Service diagnostics for your app. For more information about the App Service diagnostics tool, see [Azure App Service diagnostics overview](overview-diagnostics.md).
35+
36+
- App Service provides built-in diagnostics logging to assist with debugging apps. For more information about the built-in logs, see [Stream diagnostics logs](troubleshoot-diagnostic-logs.md#stream-logs).
37+
38+
- You can also use Azure Health check to monitor App Service instances. For more information, see [Monitor App Service instances using Health check](monitor-instances-health-check.md).
39+
40+
41+
## Analyze monitoring data using Azure Monitor
42+
43+
These Azure Monitor tools are available in the Azure portal to help you analyze monitoring data:
44+
45+
- Some Azure services have a built-in monitoring dashboard in the Azure portal. These dashboards are called *insights*, and you can find them in the **Insights** section of Azure Monitor in the Azure portal.
46+
47+
- [Metrics explorer](/azure/azure-monitor/essentials/metrics-getting-started) allows you to view and analyze metrics for Azure resources. For more information, see [Analyze metrics with Azure Monitor metrics explorer](/azure/azure-monitor/essentials/metrics-getting-started).
48+
49+
- [Log Analytics](/azure/azure-monitor/learn/quick-create-workspace) allows you to query and analyze log data using the [Kusto query language (KQL)](/azure/data-explorer/kusto/query). For more information, see [Get started with log queries in Azure Monitor](/azure/azure-monitor/logs/get-started-queries).
50+
51+
- The [activity log](/azure/azure-monitor/essentials/activity-log) has a user interface in the Azure portal for viewing and basic searches. To do more in-depth analysis, route the data to Azure Monitor logs and run more complex queries in Log Analytics.
52+
53+
- [Application Insights](/azure/azure-monitor/app/app-insights-overview) monitors the availability, performance, and usage of your web applications, so you can identify and diagnose errors without waiting for a user to report them.</br>Application Insights includes connection points to various development tools and integrates with Visual Studio to support your DevOps processes. For more information, see [Application monitoring for App Service](/azure/azure-monitor/app/azure-web-apps).
54+
55+
Tools that allow more complex visualization include:
56+
57+
- [Dashboards](/azure/azure-monitor/visualize/tutorial-logs-dashboards) that let you combine different kinds of data into a single pane in the Azure portal.
58+
- [Workbooks](/azure/azure-monitor/visualize/workbooks-overview), customizable reports that you can create in the Azure portal. Workbooks can include text, metrics, and log queries.
59+
- [Grafana](/azure/azure-monitor/visualize/grafana-plugin), an open platform tool that excels in operational dashboards. You can use Grafana to create dashboards that include data from multiple sources other than Azure Monitor.
60+
- [Power BI](/azure/azure-monitor/logs/log-powerbi), a business analytics service that provides interactive visualizations across various data sources. You can configure Power BI to automatically import log data from Azure Monitor to take advantage of these visualizations.
61+
62+
## Export Azure Monitor data
63+
64+
You can get data out of Azure Monitor into other tools by using the following methods:
65+
66+
- **Metrics:** Use the [REST API for metrics](/rest/api/monitor/operation-groups) to extract metric data from the Azure Monitor metrics database. For more information, see [Azure Monitor REST API reference](/rest/api/monitor/filter-syntax).
67+
68+
- **Logs:** Use the REST API or the [associated client libraries](/rest/api/loganalytics/query/get?tabs=HTTP).
69+
- Another option is the [workspace data export](/azure/azure-monitor/logs/logs-data-export?tabs=portal).
70+
71+
To get started with the REST API for Azure Monitor, see [Azure monitoring REST API walkthrough](/azure/azure-monitor/essentials/rest-api-walkthrough?tabs=portal).
72+
73+
## Use Kusto queries to analyze log data
74+
75+
You can analyze Azure Monitor Log data using the Kusto query language (KQL). For more information, see [Log queries in Azure Monitor](/azure/azure-monitor/logs/log-query-overview).
76+
77+
For a list of common queries for any service, see the [Log Analytics queries interface](/azure/azure-monitor/logs/queries).
78+
79+
The following sample query can help you monitor app logs using `AppServiceAppLogs`:
80+
81+
```Kusto
82+
AppServiceAppLogs
83+
| project CustomLevel, _ResourceId
84+
| summarize count() by CustomLevel, _ResourceId
85+
```
86+
87+
The following sample query can help you monitor HTTP logs using `AppServiceHTTPLogs` where the `HTTP response code` is `500` or higher:
88+
89+
```Kusto
90+
AppServiceHTTPLogs
91+
//| where ResourceId = "MyResourceId" // Uncomment to get results for a specific resource Id when querying over a group of Apps
92+
| where ScStatus >= 500
93+
| reduce by strcat(CsMethod, ':\\', CsUriStem)
94+
```
95+
96+
The following sample query can help you monitor HTTP 500 errors by joining `AppServiceConsoleLogs` and `AppserviceHTTPLogs`:
97+
98+
```Kusto
99+
let myHttp = AppServiceHTTPLogs | where ScStatus == 500 | project TimeGen=substring(TimeGenerated, 0, 19), CsUriStem, ScStatus;
100+
101+
let myConsole = AppServiceConsoleLogs | project TimeGen=substring(TimeGenerated, 0, 19), ResultDescription;
102+
103+
myHttp | join myConsole on TimeGen | project TimeGen, CsUriStem, ScStatus, ResultDescription;
104+
```
105+
106+
See [Azure Monitor queries for App Service](https://github.com/microsoft/AzureMonitorCommunity/tree/master/Azure%20Services/App%20Services/Queries) for more sample queries.
107+
108+
## Use Azure Monitor alerts to notify you of issues
109+
110+
Azure Monitor alerts proactively notify you when specific conditions are found in your monitoring data. Alerts allow you to identify and address issues in your system before your customers notice them. For more information, see [Azure Monitor alerts](/azure/azure-monitor/alerts/alerts-overview).
111+
112+
You can alert on any metric or log data source in the Azure Monitor data platform. There are different types of alerts depending on the services you're monitoring and the monitoring data you're collecting. See [Choose the right monitoring alert type](/azure/azure-monitor/alerts/alerts-types).
113+
114+
This table provides a brief description of each alert type. For more information about each alert type and how to choose which alert type best suits your needs, see [Types of Azure Monitor alerts](alerts-types.md).
115+
116+
|Alert type|Description|
117+
|:---------|:---------|
118+
|[Metric alerts](alerts-types.md#metric-alerts)|Metric alerts evaluate resource metrics at regular intervals. Metrics can be platform metrics, custom metrics, logs from Azure Monitor converted to metrics, or Application Insights metrics. Metric alerts can also apply multiple conditions and dynamic thresholds.|
119+
|[Log search alerts](alerts-types.md#log-alerts)|Log search alerts allow users to use a Log Analytics query to evaluate resource logs at a predefined frequency.|
120+
|[Activity log alerts](alerts-types.md#activity-log-alerts)|Activity log alerts are triggered when a new activity log event occurs that matches defined conditions. Resource Health alerts and Service Health alerts are activity log alerts that report on your service and resource health.|
121+
|[Smart detection alerts](alerts-types.md#smart-detection-alerts)|Smart detection on an Application Insights resource automatically warns you of potential performance problems and failure anomalies in your web application. You can migrate smart detection on your Application Insights resource to create alert rules for the different smart detection modules.|
122+
|[Prometheus alerts](alerts-types.md#prometheus-alerts)|Prometheus alerts are used for alerting on Prometheus metrics stored in [Azure Monitor managed services for Prometheus](../essentials/prometheus-metrics-overview.md). The alert rules are based on the PromQL open-source query language.|
123+
124+
For examples of common alerts for Azure resources, see [Sample log alert queries](/azure/azure-monitor/alerts/alerts-log-alert-query-samples).
125+
126+
### Implementing alerts at scale
127+
128+
For some services, you can monitor at scale by applying the same metric alert rule to multiple resources of the same type that exist in the same Azure region. [Azure Monitor Baseline Alerts (AMBA)](https://aka.ms/amba) provides a semi-automated method of implementing important platform metric alerts, dashboards, and guidelines at scale.
129+
130+
### App Service alert rules
131+
132+
The following table lists common and recommended alert rules for App Service.
133+
134+
| Alert type | Condition | Examples |
135+
|:---|:---|:---|
136+
| Metric | Average connections| When number of connections exceed a set value|
137+
| Metric | HTTP 404| When HTTP 404 responses exceed a set value|
138+
| Metric | HTTP Server Errors| When HTTP 5xx errors exceed a set value|
139+
| Activity Log | Create or Update Web App | When app is created or updated|
140+
| Activity Log | Delete Web App | When app is deleted|
141+
| Activity Log | Restart Web App| When app is restarted|
142+
| Activity Log | Stop Web App| When app is stopped|
143+
144+
>[!NOTE]
145+
>If you're creating or running an application that runs on your service, [Azure Monitor application insights](/azure/azure-monitor/overview#application-insights) might offer more types of alerts.
146+
147+
### Get personalized recommendations using Advisor
148+
149+
For some services, if critical conditions or imminent changes occur during resource operations, an alert displays on the service **Overview** page in the portal. You can find more information and recommended fixes for the alert in **Advisor recommendations** under **Monitoring** in the left menu. During normal operations, no advisor recommendations display.
150+
151+
For more information on Azure Advisor, see [Azure Advisor overview](/azure/advisor/advisor-overview).
152+
153+
## Related content
154+
155+
- See [App Service monitoring data reference](/azure/app-service/monitor-app-service-reference.md) for a reference of the metrics, logs, and other important values created for App Service.
156+
- See [Monitoring Azure resources with Azure Monitor](/azure/azure-monitor/essentials/monitor-azure-resource) for general details on monitoring Azure resources.

articles/azure-monitor/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,3 +1614,5 @@ items:
16141614
href: https://azure.microsoft.com/pricing/calculator/
16151615
- name: Regional availability
16161616
href: https://azure.microsoft.com/global-infrastructure/services/?regions=all&products=monitor
1617+
- name: Monitor App Service
1618+
href: monitor-horizontal-test.md

0 commit comments

Comments
 (0)