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/application-gateway/for-containers/prometheus-grafana.md
+44-40Lines changed: 44 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,9 +33,7 @@ You can monitor Azure Application Gateway for Containers resources in the follow
33
33
34
34
-[Diagnostic Logs](../../application-gateway/for-containers/diagnostics.md): Access Logs audit all requests made to Application Gateway for Containers. Logs can provide several characteristics, such as the client's IP, requested URL, request latencies, return code, and bytes in and out. An access log is collected every 60 seconds. This includes the activity log, access log, and firewall log.
35
35
36
-
:::image
37
-
type="content" source="./media/prometheus-grafana/agc-monitoring-flowchart.png" alt-text="Screenshot of architecture grid diagram." lightbox="./media/prometheus-grafana/agc-monitoring-flowchart.png"
38
-
:::
36
+
:::image type="content" source="./media/prometheus-grafana/agc-monitoring-flowchart.png" alt-text="Screenshot of architecture grid diagram." lightbox="./media/prometheus-grafana/agc-monitoring-flowchart.png":::
39
37
40
38
## Prerequisites
41
39
- An active Kubernetes cluster.
@@ -49,16 +47,16 @@ Azure Monitor includes native support for Grafana dashboards directly within the
49
47
Use the following steps to use the Grafana dashboards that are already available in the Azure portal with the data sources from Azure Monitor managed service for Prometheus metrics scraped from Kubernetes clusters.
50
48
51
49
1. In the Azure portal, navigate to your AKS cluster.
52
-
2. Select **Monitoring**.
53
-
3. Select **Dashboards with Grafana**.
54
-
4. Select **Configure**.
55
-
5. Select **Enable Prometheus Metrics** and **Container Logs**. Under **Advanced Settings**, select your specific Azure Monitor workspace, Log Analytics workspace, and log presets.
50
+
1. Select **Monitoring**.
51
+
1. Select **Dashboards with Grafana**.
52
+
1. Select **Configure**.
53
+
1. Select **Enable Prometheus Metrics** and **Container Logs**. Under **Advanced Settings**, select your specific Azure Monitor workspace, Log Analytics workspace, and log presets.
56
54
57
-

55
+
:::image type="content" source="./media/prometheus-grafana/configure-monitor-with-grafana.png" alt-text="Screenshot of configuring monitoring with Grafana.":::
58
56
59
-
6. Browse the list of available dashboards in the Azure Managed Prometheus listings.
57
+
1. Browse the list of available dashboards in the Azure Managed Prometheus listings.
60
58
61
-

59
+
:::image type="content" source="./media/prometheus-grafana/prometheus-template.png" alt-text="Screenshot of Prometheus template dashboards.":::
62
60
63
61
See additional customization in [Azure Monitor Dashboards with Grafana](/azure/azure-monitor/visualize/visualize-use-grafana-dashboards)
64
62
@@ -67,69 +65,75 @@ Azure Managed Grafana provides a dedicated, fully managed Grafana instance with
67
65
68
66
## Complete the steps to configure Prometheus and Grafana
69
67
1. Sign in to the [Azure portal](https://portal.azure.com) with your Azure account.
70
-
2. Navigate to your AKS cluster in the Azure portal.
68
+
1. Navigate to your AKS cluster in the Azure portal.
71
69
-**New AKS cluster**: Configure monitoring in the **Monitoring** tab and enable Prometheus metrics and container logs.
72
70
-**Existing cluster**: Navigate to your cluster in the Azure portal. In the service menu, select **Monitor** and then **Monitor Settings**.
73
71
74
-

72
+
:::image type="content" source="./media/prometheus-grafana/configure-monitor-with-grafana.png" alt-text="Screenshot of configuring Azure Monitor with Grafana.":::
73
+
74
+
1. In the **Search resources, services, and docs (G+/)** box, enter *Azure Managed Grafana* and select **Azure Managed Grafana**.
75
+
1. Create an [Azure Managed Grafana workspace](/azure/managed-grafana/quickstart-managed-grafana-portal).
75
76
76
-
3. In the **Search resources, services, and docs (G+/)** box, enter *Azure Managed Grafana* and select **Azure Managed Grafana**.
77
-
4. Create an [Azure Managed Grafana workspace](/azure/managed-grafana/quickstart-managed-grafana-portal).
78
77
> [!NOTE]
79
78
> An Azure Managed Grafana instance is automatically configured with a managed identity with the Monitoring Data Reader role. This role allows the identity to read monitoring data for the subscription. The identity is used to authenticate Grafana to Azure Monitor.
80
-
5. Create an [Azure Monitor workspace](/azure/azure-monitor/metrics/azure-monitor-workspace-manage?tabs=azure-portal). Copy the **Query endpoint**.
81
79
82
-

80
+
1. Create an [Azure Monitor workspace](/azure/azure-monitor/metrics/azure-monitor-workspace-manage?tabs=azure-portal). Copy the **Query endpoint**.
81
+
82
+
:::image type="content" source="./media/prometheus-grafana/query-endpoint.png" alt-text="Screenshot of the Monitor query endpoint.":::
83
83
84
84
85
85
## Create the Prometheus data source in Grafana
86
86
1. Open your Azure Managed Grafana workspace in the Azure portal and select the endpoint to view the Grafana workspace.
87
-
2. Select **Connections** > **Data sources** and then select **Add data source**.
88
-
3. Search for and select **Prometheus**.
89
-
4. Paste the query endpoint from your Azure Monitor workspace into the **Prometheus server URL** field.
90
-
5. Under **Authentication**, select **Azure Auth**.
91
-
6. Under **Azure Authentication**, select **Managed Identity** from the **Authentication** dropdown list.
92
-
7. Scroll to the bottom of the page and select **Save & test**.
87
+
1. Select **Connections** > **Data sources** and then select **Add data source**.
88
+
1. Search for and select **Prometheus**.
89
+
1. Paste the query endpoint from your Azure Monitor workspace into the **Prometheus server URL** field.
90
+
1. Under **Authentication**, select **Azure Auth**.
91
+
1. Under **Azure Authentication**, select **Managed Identity** from the **Authentication** dropdown list.
92
+
1. Scroll to the bottom of the page and select **Save & test**.
93
93
94
-

94
+
:::image type="content" source="./media/prometheus-grafana/prometheus-data-source.png" alt-text="Screenshot of the Prometheus data source configuration.":::
95
95
96
96
## Graph Prometheus metrics on Grafana
97
97
A Grafana dashboard contains panels and rows. You can import a Grafana dashboard and adapt it to your own scenario, create a new Grafana dashboard, or duplicate an existing dashboard.
98
98
99
99
1. In the Azure portal, open your Azure Managed Grafana workspace and select the **Endpoint URL**.
100
100
101
-
2. In the Grafana portal, go to **Dashboards** > **New Dashboard**.
101
+
1. In the Grafana portal, go to **Dashboards** > **New Dashboard**.
102
102
103
-
3. Select one of the following options:
103
+
1. Select one of the following options:
104
104
-**Add a new panel**: Instantly creates a dashboard from scratch with a first default panel.
105
105
-**Add a new row**: Instantly creates a dashboard with a new empty row.
106
106
-**Add a panel from the panel library**: Instantly creates a dashboard with an existing reusable panel from another workspace you have access to.
107
-
4. Select **Add a new panel**.
108
-
5. Search for and select **Prometheus** as a data source.
109
-
6. Select the desired metric. For example, select `alb_controller_total_unhealthy_endpoints` to show any unhealthy endpoints of your backend service. Choose **app** as `alb-controller`. Select the name of the panel, type of visualization, and time range.
107
+
1. Select **Add a new panel**.
108
+
1. Search for and select **Prometheus** as a data source.
109
+
1. Select the desired metric. For example, select `alb_controller_total_unhealthy_endpoints` to show any unhealthy endpoints of your backend service. Choose **app** as `alb-controller`. Select the name of the panel, type of visualization, and time range.
110
+
111
+
:::image type="content" source="./media/prometheus-grafana/prometheus-grafana-viewing.png" alt-text="Screenshot of the Prometheus metrics visualization in Grafana.":::
110
112
111
-

112
-
7. Select **Save** and **Apply** to add the panel to your dashboard.
113
+
1. Select **Save** and **Apply** to add the panel to your dashboard.
113
114
114
115
115
116
## Graph Azure Monitor Logs on Grafana
116
117
After you create the resources, you can combine them and configure Prometheus.
117
118
1. Expand the menu on the left and select **Connections** > **Data sources**.
118
119
119
-

120
+
:::image type="content" source="./media/prometheus-grafana/monitordata-source-configuration.png" alt-text="Screenshot of the Monitor data source configuration.":::
120
121
121
-
2.**Azure Monitor** is listed as a built-in data source for your Azure Managed Grafana workspace. Select **Azure Monitor**.
122
-
3. In the **Settings** tab, authenticate through **Managed Identity** and select your subscription from the dropdown list. When you select managed identity, the authentication and authorization are made through the system-assigned or the user-assigned managed identity you configured in your Azure Managed Grafana workspace.
123
-
4. Select **Add a new panel**.
124
-
5. Search for and select **Azure Monitor** as a data source.
125
-
6. Enter the following example query:
122
+
1.**Azure Monitor** is listed as a built-in data source for your Azure Managed Grafana workspace. Select **Azure Monitor**.
123
+
1. In the **Settings** tab, authenticate through **Managed Identity** and select your subscription from the dropdown list. When you select managed identity, the authentication and authorization are made through the system-assigned or the user-assigned managed identity you configured in your Azure Managed Grafana workspace.
124
+
1. Select **Add a new panel**.
125
+
1. Search for and select **Azure Monitor** as a data source.
126
+
1. Enter the following example query:
126
127
```kusto
127
128
AGCAccessLogs
128
129
| project BackendResponseLatency, TimeGenerated
129
130
```
130
131
131
-
7. Select **Time Series** as a visualization.
132
-
8. Select the name, description, and time range of the panel.
132
+
1. Select **Time Series** as a visualization.
133
+
1. Select the name, description, and time range of the panel.
134
+
135
+
:::image type="content" source="./media/prometheus-grafana/logging-example.png" alt-text="Screenshot of an Application Gateway for Containers logging example.":::
136
+
137
+
1. Select **Save** and **Apply** to add the panel to your dashboard.
133
138
134
-

135
-
9. Select **Save** and **Apply** to add the panel to your dashboard.
139
+
Congratulations! You set up a monitoring service to enhance your health tracking!
0 commit comments