Skip to content

Commit 2cba2f0

Browse files
SUMO-259572 | Add. monitors and new dashboard to Azure Web Apps (#5374)
* SUMO-259572 | Apoorv | Add. monitors and new dashboard * Update docs/integrations/microsoft-azure/web-apps.md --------- Co-authored-by: Kim (Sumo Logic) <[email protected]>
1 parent f4aeebb commit 2cba2f0

File tree

1 file changed

+49
-95
lines changed

1 file changed

+49
-95
lines changed

docs/integrations/microsoft-azure/web-apps.md

Lines changed: 49 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ For Azure Web Apps, you can collect the following logs and metrics:
3030
- **Activity logs**, provides insight into any subscription-level or management group level events that have occurred in the Azure. To learn more, refer to [Azure documentation](https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/activity-log-schema).
3131

3232
* **Azure WebApps platform metrics**. These are metrics specific to Functions like execution count and execution units.
33-
For more information on supported metrics, refer to [Azure documentation](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-web-sites-metrics).
33+
For more information on supported metrics, refer to [Azure documentation](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-web-sites-metrics).
3434

3535
### Sample log messages
3636

@@ -58,102 +58,15 @@ Azure service sends monitoring data to Azure Monitor, which can then [stream dat
5858

5959
* Logs collection from [Azure Monitor](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-get-started) using our [Azure Event Hubs source](/docs/send-data/collect-from-other-data-sources/azure-monitoring/ms-azure-event-hubs-source/).
6060
* Activity Logs collection from [Azure Monitor](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-get-started) using our [Azure Event Hubs source](/docs/send-data/collect-from-other-data-sources/azure-monitoring/ms-azure-event-hubs-source/). It is recommended to create a separate source for activity logs. If you are already collecting these logs, you can skip this step.
61-
* Metrics collection using our [HTTP Logs and Metrics source](/docs/send-data/collect-from-other-data-sources/azure-monitoring/collect-metrics-azure-monitor/) via Azure Functions deployed using the ARM template.
61+
* Metrics collection using our [Azure Metrics Source](/docs/send-data/hosted-collectors/microsoft-source/azure-metrics-source).
6262

6363
You must explicitly enable diagnostic settings for each web app that you want to monitor. You can forward logs to the same event hub provided they satisfy the limitations and permissions as described [here](https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings?tabs=portal#destination-limitations).
6464

6565
When you configure the event hubs source or HTTP source, plan your source category to ease the querying process. A hierarchical approach allows you to make use of wildcards. For example: `Azure/WebApps/Logs`, `Azure/WebApps/Metrics`.
6666

67-
### Configure field in field schema
68-
1. [**Classic UI**](/docs/get-started/sumo-logic-ui-classic). In the main Sumo Logic menu, select **Manage Data > Logs > Fields**. <br/>[**New UI**](/docs/get-started/sumo-logic-ui). In the top menu select **Configuration**, and then under **Logs** select **Fields**. You can also click the **Go To...** menu at the top of the screen and select **Fields**.
69-
1. Search for following fields:
70-
- `tenant_name`. This field is tagged at the collector level and you can get the tenant name using the instructions [here](https://learn.microsoft.com/en-us/azure/active-directory-b2c/tenant-management-read-tenant-name#get-your-tenant-name).
71-
- `location`. The region to which the resource name belongs to.
72-
- `subscription_id`. ID associated with a subscription where resource is present.
73-
- `resource_group`. The resource group name where the Azure resource is present.
74-
- `provider_name`. Azure resource provider name (for example, Microsoft.WEB).
75-
- `resource_type`. Azure resource type (for example, SITES).
76-
- `resource_name`. The name of the resource (for example, Azure Function App name).
77-
1. Create the fields if they are not present. Refer to [Manage fields](/docs/manage/fields/#manage-fields).
78-
79-
### Configure Field Extraction Rules
80-
81-
Create a Field Extraction Rule (FER) by following the instructions [here](/docs/manage/field-extractions/create-field-extraction-rule/). If the FER already exists with same name, then skip this step.
82-
83-
#### Azure Location Extraction FER
84-
85-
```sql
86-
Rule Name: AzureLocationExtractionFER
87-
Applied at: Ingest Time
88-
Scope (Specific Data): tenant_name=*
89-
```
90-
91-
```sql title="Parse Expression"
92-
json "location", "properties.resourceLocation", "properties.region" as location, resourceLocation, service_region nodrop
93-
| replace(toLowerCase(resourceLocation), " ", "") as resourceLocation
94-
| if (!isBlank(resourceLocation), resourceLocation, location) as location
95-
| if (!isBlank(service_region), service_region, location) as location
96-
| if (isBlank(location), "global", location) as location
97-
| fields location
98-
```
99-
100-
#### Resource ID Extraction FER
101-
102-
```sql
103-
Rule Name: AzureResourceIdExtractionFER
104-
Applied at: Ingest Time
105-
Scope (Specific Data): tenant_name=*
106-
```
107-
108-
```sql title="Parse Expression"
109-
json "resourceId", "ResourceId" as resourceId1, resourceId2 nodrop
110-
| if (isBlank(resourceId1), resourceId2, resourceId1) as resourceId
111-
| toUpperCase(resourceId) as resourceId
112-
| parse regex field=resourceId "/SUBSCRIPTIONS/(?<subscription_id>[^/]+)" nodrop
113-
| parse field=resourceId "/RESOURCEGROUPS/*/" as resource_group nodrop
114-
| parse regex field=resourceId "/PROVIDERS/(?<provider_name>[^/]+)" nodrop
115-
| parse regex field=resourceId "/PROVIDERS/[^/]+(?:/LOCATIONS/[^/]+)?/(?<resource_type>[^/]+)/(?<resource_name>.+)" nodrop
116-
| parse regex field=resource_name "(?<parent_resource_name>[^/]+)(?:/PROVIDERS/[^/]+)?/(?<service_type>[^/]+)/?(?<service_name>.+)" nodrop
117-
| if (isBlank(parent_resource_name), resource_name, parent_resource_name) as resource_name
118-
| fields subscription_id, location, provider_name, resource_group, resource_type, resource_name, service_type, service_name
119-
```
120-
121-
122-
### Configure metric rules
123-
124-
#### Azure Observability Metadata Extraction Service Level
125-
126-
If this rule already exists, there's no need to create it again.
127-
128-
```sql
129-
Rule Name: AzureObservabilityMetadataExtractionAppServiceLevel
130-
```
131-
132-
```sql title="Metric match expression"
133-
resourceId=/SUBSCRIPTIONS/*/RESOURCEGROUPS/*/PROVIDERS/*/SITES/* tenant_name=*
134-
```
135-
136-
| Fields extracted | Metric rule |
137-
|:-----------------|:---------------|
138-
| `subscription_id` | $resourceId._1 |
139-
| `resource_group` | $resourceId._2 |
140-
| `provider_name` | $resourceId._3 |
141-
| `resource_type` | SITES |
142-
| `resource_name` | $resourceId._4 |
143-
144-
14567
### Configure metrics collection
14668

147-
In this section, you will configure a pipeline for shipping metrics from Azure Monitor to an Event Hub, on to an Azure Function, and finally to an HTTP Source on a hosted collector in Sumo Logic.
148-
149-
1. [Configure an HTTP Source](/docs/send-data/collect-from-other-data-sources/azure-monitoring/collect-metrics-azure-monitor/#step-1-configure-an-http-source).
150-
2. [Configure and deploy the ARM Template](/docs/send-data/collect-from-other-data-sources/azure-monitoring/collect-metrics-azure-monitor/#step-2-configure-azure-resources-using-arm-template).
151-
3. [Export metrics to Event Hub](/docs/send-data/collect-from-other-data-sources/azure-monitoring/collect-metrics-azure-monitor/#step-3-export-metrics-for-a-particular-resource-to-event-hub). Perform below steps for each Azure WebApps that you want to monitor.
152-
1. Choose `Stream to an event hub` as destination.
153-
1. Select `AllMetrics`.
154-
1. Use the Event Hub namespace created by the ARM template in Step 2 above. You can create a new Event Hub or use the one created by ARM template. You can use the default policy `RootManageSharedAccessKey` as the policy name. <br/><img src={useBaseUrl('img/send-data/azure-webapps-metrics.png')} alt="Azure WebApps metrics" style={{border: '1px solid gray'}} width="800" />
155-
4. Tag the location field in the source with right location value.<br/><img src={useBaseUrl('img/integrations/microsoft-azure/Azure-Storage-Tag-Location.png')} alt="Azure WebApps Tag Location" style={{border: '1px solid gray'}} width="400" />
156-
69+
To set up the Azure Metrics source in Sumo Logic, refer to [Azure Metrics Source](/docs/send-data/hosted-collectors/microsoft-source/azure-metrics-source).
15770

15871
### Configure logs collection
15972

@@ -163,10 +76,9 @@ In this section, you will configure a pipeline for shipping diagnostic logs from
16376

16477
1. To set up the Azure Event Hubs source in Sumo Logic, refer to the [Azure Event Hubs Source for Logs](/docs/send-data/collect-from-other-data-sources/azure-monitoring/ms-azure-event-hubs-source/).
16578
2. To create the **Diagnostic setting** in the Azure portal, refer to the [Azure documentation](https://learn.microsoft.com/en-gb/azure/data-factory/monitor-configure-diagnostics). Perform the below steps for each Azure WebApps that you want to monitor.
166-
1. Choose `Stream to an event hub` as the destination.
167-
1. Select `HTTP logs`, `App Service Console Logs`, `App Service Application Logs`, `Access Audit Logs`, `IPSecurity Audit logs`, `App Service Platform logs`, `Report Antivirus Audit Logs`, `Site Content Change Audit Logs`.
168-
1. Use the Event Hub namespace and Event Hub name configured in previous step in destination details section. You can use the default policy `RootManageSharedAccessKey` as the policy name.
169-
<img src={useBaseUrl('img/send-data/azure-webapps-logs.png')} alt="Azure WebApps logs" style={{border: '1px solid gray'}} width="800" />
79+
1. Choose `Stream to an event hub` as the destination.
80+
1. Select `HTTP logs`, `App Service Console Logs`, `App Service Application Logs`, `Access Audit Logs`, `IPSecurity Audit logs`, `App Service Platform logs`, `Report Antivirus Audit Logs`, `Site Content Change Audit Logs`.
81+
1. Use the Event Hub namespace and Event Hub name configured in previous step in destination details section. You can use the default policy `RootManageSharedAccessKey` as the policy name.<br/><img src={useBaseUrl('img/send-data/azure-webapps-logs.png')} alt="Azure WebApps logs" style={{border: '1px solid gray'}} width="800" />
17082
3. Tag the location field in the source with right location value.<br/><img src={useBaseUrl('img/integrations/microsoft-azure/Azure-Storage-Tag-Location.png')} alt="Azure WebApps Tag Location" style={{border: '1px solid gray'}} width="400" />
17183

17284
#### Activity logs (optional)
@@ -199,6 +111,18 @@ import AppInstall2 from '../../reuse/apps/app-install-v2.md';
199111

200112
<AppInstall2/>
201113

114+
As part of the app installation process, the following fields will be created by default:
115+
116+
- `tenant_name`. This field is tagged at the collector level. You can get the tenant name using the instructions [here](https://learn.microsoft.com/en-us/azure/active-directory-b2c/tenant-management-read-tenant-name#get-your-tenant-name).
117+
- `location`. The region to which the resource name belongs to.
118+
- `subscription_id`. ID associated with a subscription where the resource is present.
119+
- `resource_group`. The resource group name where the Azure resource is present.
120+
- `provider_name`. Azure resource provider name (for example, Microsoft.Network).
121+
- `resource_type`. Azure resource type (for example, storage accounts).
122+
- `resource_name`. The name of the resource (for example, storage account name).
123+
- `service_type`. Type of the service that can be accessed with a Azure resource.
124+
- `service_name`. Services that can be accessed with an Azure resource (for example, in Azure Container Instances the service is Subscriptions).
125+
202126
## Viewing Azure Web Apps dashboards
203127

204128
import ViewDashboards from '../../reuse/apps/view-dashboards.md';
@@ -350,7 +274,7 @@ Use this dashboard to:
350274

351275
### Administrative Operations
352276

353-
The **Azure SQL - Administrative Operations** dashboard provides details on read/write/delete specific changes, different operations used, top 10 operations that caused most errors, and users performing admin operations.
277+
The **Azure WebApps - Administrative Operations** dashboard provides details on read/write/delete specific changes, different operations used, top 10 operations that caused most errors, and users performing admin operations.
354278

355279
Use this dashboard to:
356280
* Identify top users performing administrative operations.
@@ -359,6 +283,36 @@ Use this dashboard to:
359283

360284
<img src={useBaseUrl('https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/Azure-WebApps/Azure-WebApps-Administrative-Operations.png')} alt="Azure WebApps Administrative Operations dashboard" style={{border: '1px solid gray'}} width="800" />
361285

286+
### Instances
287+
288+
The **Azure Web Apps - Instances** dashboard provides information of all effect action details performed based on Azure Web Apps Instances.
289+
290+
Use this dashboard to:
291+
* View recent resource usage and performance based on Instances.
292+
* View distribution and service usage of resources by Instance.
293+
294+
<img src={useBaseUrl('https://sumologic-app-data-v2.s3.us-east-1.amazonaws.com/dashboards/Azure-WebApps/Azure-WebApps-Instances.png')} alt="Azure Web Apps Instances dashboard" style={{border: '1px solid gray'}} width="800" />
295+
296+
297+
## Create monitors for Azure Web Apps app
298+
299+
import CreateMonitors from '../../reuse/apps/create-monitors.md';
300+
301+
<CreateMonitors/>
302+
303+
### Azure Web Apps alerts
304+
305+
These alerts are metrics-based and will work for all Web Apps.
306+
307+
| Alert Name | Description | Alert Condition | Recover Condition |
308+
|:------------------------------------------|:-------------------------------------------------------------------------------------------|:----------------|:------------------|
309+
| `Azure Web Apps - Average Response Time` | This alert gets triggered when there is high response time detected in any Azure Function. | Count < 1 | Count >= 1 |
310+
| `Azure Web Apps - Delete function app` | This alert gets triggered when a function app is deleted. | Count >= 1 | Count < 1 |
311+
| `Azure Web Apps - Health Check Status` | This alert gets triggered when there is Health Check Status average drops less than 100. | Count < 100 | Count >= 100 |
312+
| `Azure Web Apps - Http 4xx Error` | This alert gets triggered when HTTP 4xx errors are high in the Azure Web Apps. | Count > 25 | Count =< 25 |
313+
| `Azure Web Apps - Https Server Error` | This alert gets triggered when HTTP 5xx errors are high in the Azure Web Apps. | Count > 25 | Count =< 25 |
314+
315+
362316
## Upgrade/Downgrade the Azure Web Apps app (Optional)
363317

364318
import AppUpdate from '../../reuse/apps/app-update.md';

0 commit comments

Comments
 (0)