You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/api-management/api-management-howto-use-azure-monitor.md
+19-18Lines changed: 19 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
---
2
2
title: Tutorial - Monitor published APIs in Azure API Management | Microsoft Docs
3
-
description: Follow the steps of this tutorial to learn how to use metrics, alerts, activity logs, and resource logs to monitor your APIs in Azure API Management.
3
+
description: Learn how to use metrics, alerts, activity logs, and resource logs to monitor your APIs in Azure API Management.
4
4
services: api-management
5
5
author: dlepow
6
6
7
7
ms.service: api-management
8
-
ms.custom: mvc
8
+
ms.custom: mvc, devdivchpfy22
9
9
ms.topic: tutorial
10
-
ms.date: 10/14/2020
10
+
ms.date: 12/09/2021
11
11
ms.author: danlep
12
12
---
13
13
# Tutorial: Monitor published APIs
@@ -17,8 +17,8 @@ With Azure Monitor, you can visualize, query, route, archive, and take actions o
17
17
In this tutorial, you learn how to:
18
18
19
19
> [!div class="checklist"]
20
-
> * View metrics of your API
21
-
> * Set up an alert rule
20
+
> * View metrics of your API
21
+
> * Set up an alert rule
22
22
> * View activity logs
23
23
> * Enable and view resource logs
24
24
@@ -37,12 +37,12 @@ You can also use API Management's built-in [analytics](howto-use-analytics.md) t
37
37
API Management emits [metrics](../azure-monitor/essentials/data-platform-metrics.md) every minute, giving you near real-time visibility into the state and health of your APIs. The following are the two most frequently used metrics. For a list of all available metrics, see [supported metrics](../azure-monitor/essentials/metrics-supported.md#microsoftapimanagementservice).
38
38
39
39
***Capacity** - helps you make decisions about upgrading/downgrading your APIM services. The metric is emitted per minute and reflects the gateway capacity at the time of reporting. The metric ranges from 0-100 calculated based on gateway resources such as CPU and memory utilization.
40
-
***Requests** - helps you analyze API traffic going through your API Management services. The metric is emitted per minute and reports the number of gateway requests with dimensions including response codes, location, hostname, and errors.
40
+
***Requests** - helps you analyze API traffic going through your API Management services. The metric is emitted per minute and reports the number of gateway requests with dimensions. Filter requests by response codes, location, hostname, and errors.
41
41
42
42
> [!IMPORTANT]
43
43
> The following metrics have been deprecated as of May 2019 and will be retired in August 2023: Total Gateway Requests, Successful Gateway Requests, Unauthorized Gateway Requests, Failed Gateway Requests, Other Gateway Requests. Please migrate to the Requests metric which provides equivalent functionality.
44
44
45
-
:::image type="content" source="media/api-management-howto-use-azure-monitor/apim-monitor-metrics.png" alt-text="Screenshot of Metrics in API Management Overview":::
45
+
:::image type="content" source="media/api-management-howto-use-azure-monitor/apim-monitor-metrics-1.png" alt-text="Screenshot of Metrics in API Management Overview":::
46
46
47
47
To access metrics:
48
48
@@ -51,11 +51,11 @@ To access metrics:
51
51
52
52
:::image type="content" source="media/api-management-howto-use-azure-monitor/api-management-metrics-blade.png" alt-text="Screenshot of Metrics item in Monitoring menu":::
53
53
54
-
1. From the drop-down, select metrics you are interested in. For example, **Requests**.
54
+
1. From the drop-down, select metrics you're interested in. For example, **Requests**.
55
55
1. The chart shows the total number of API calls.
56
-
1.The chart can be filtered using the dimensions of the **Requests** metric. For example, select **Add filter**, select **Backend Response Code Category**, enter 500 as the value. Now the chart shows the number of requests that were failed in the API backend.
56
+
1.You can filter the chart using the dimensions of the **Requests** metric. For example, select **Add filter**, select **Backend Response Code Category**, enter 500 as the value. The chart shows the number of requests failed in the API backend.
57
57
58
-
## Set up an alert rule
58
+
## Set up an alert rule
59
59
60
60
You can receive [alerts](../azure-monitor/alerts/alerts-metric-overview.md) based on metrics and activity logs. Azure Monitor allows you to [configure an alert](../azure-monitor/alerts/alerts-metric.md) to do the following when it triggers:
61
61
@@ -77,31 +77,32 @@ To configure an example alert rule based on a request metric:
77
77
1. In **Signal name**, select **Requests**.
78
78
1. In **Split by dimensions**, in **Dimension name**, select **Gateway Response Code Category**.
79
79
1. In **Dimension values**, select **4xx**, for client errors such as unauthorized or invalid requests.
80
-
1. In **Alert logic**, specify a threshold after which the alert should be triggered and select **Done**.
80
+
1. In **Alert logic**, specify a **Threshold value** after which the alert should be triggered.
81
+
1. In **Evaluated based on**, specify **Aggregation granularity** and **Frequency of evaluation**, then select **Done**.
81
82
82
-
:::image type="content" source="media/api-management-howto-use-azure-monitor/threshold.png" alt-text="Screenshot of Configure Signal Logic windows":::
83
+
:::image type="content" source="media/api-management-howto-use-azure-monitor/threshold-1.png" alt-text="Screenshot of Configure Signal Logic windows":::
83
84
84
85
1. Select an existing action group or create a new one. In the following example, a new action group is created. A notification email will be sent to [email protected].
85
86
86
87
:::image type="content" source="media/api-management-howto-use-azure-monitor/action-details.png" alt-text="Screenshot of notifications for new action group":::
87
88
88
-
1. Enter a name and description of the alert rule and select the severity level.
89
+
1. Enter a name and description of the alert rule and select the severity level.
89
90
1. Select **Create alert rule**.
90
91
1. Now, test the alert rule by calling the Conference API without an API key. For example:
91
92
92
93
```bash
93
94
curl GET https://apim-hello-world.azure-api.net/conference/speakers HTTP/1.1
94
95
```
95
96
96
-
An alert will be triggered based on the evaluation period, and email will be sent to [email protected].
97
+
An alert triggers based on the evaluation period, and it will send email to [email protected].
97
98
98
99
Alerts also appear on the **Alerts** page for the API Management instance.
99
100
100
101
:::image type="content" source="media/api-management-howto-use-azure-monitor/portal-alerts.png" alt-text="Screenshot of alerts in portal":::
101
102
102
103
## Activity logs
103
104
104
-
Activity logs provide insight into the operations that were performed on your API Management services. Using activity logs, you can determine the "what, who, and when"for any write operations (PUT, POST, DELETE) taken on your API Management services.
105
+
Activity logs provide insight into the operations on your API Management services. Using activity logs, you can determine the "what, who, and when"for any write operations (PUT, POST, DELETE) taken on your API Management services.
105
106
106
107
> [!NOTE]
107
108
> Activity logs do not include read (GET) operations or operations performed in the Azure portal or using the original Management APIs.
@@ -121,7 +122,7 @@ To view the activity log:
121
122
122
123
## Resource logs
123
124
124
-
Resource logs provide rich information about operations and errors that are important for auditing as well as troubleshooting purposes. Resource logs differ from activity logs. The activity log provides insights into the operations that were performed on your Azure resources. Resource logs provide insight into operations that your resource performed.
125
+
Resource logs provide rich information about operations and errors that are important for auditing and troubleshooting purposes. Resource logs differ from activity logs. The activity log provides insights into the operations run on your Azure resources. Resource logs provide insight into operations that your resource ran.
125
126
126
127
To configure resource logs:
127
128
@@ -133,7 +134,7 @@ To configure resource logs:
133
134
1. Select **+ Add diagnostic setting**.
134
135
1. Select the logs or metrics that you want to collect.
135
136
136
-
You can archive resource logs along with metrics to a storage account, stream them to an Event Hub, or send them to a Log Analytics workspace.
137
+
You can archive resource logs along with metrics to a storage account, stream them to an Event Hub, or send them to a Log Analytics workspace.
137
138
138
139
For more information, see [Create diagnostic settings to send platform logs and metrics to different destinations](../azure-monitor/essentials/diagnostic-settings.md).
139
140
@@ -202,7 +203,7 @@ In this tutorial, you learned how to:
0 commit comments