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
+49-46Lines changed: 49 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,16 +12,16 @@ ms.author: greglin
12
12
13
13
# Configure Application Gateway for Containers for Prometheus and Grafana
14
14
15
-
Establishing monitoring for Application Gateway for Containers is crutial part of successful operations. Firstly, it allows you to visualize how traffic is controlled, providing actionable insights that help optimize performance and troubleshoot issues promptly. Secondly, monitoring enhances security measures by providing valuable insights during investigations, ensuring that your gateway remains secure and resilient against threats. Implementing monitoring for your Application Gateway for Containers not only supports ongoing performance optimization but also strengthens your overall security posture by enabling proactive detection and response capabilities.
15
+
Establishing monitoring for Application Gateway for Containers is crucial part of successful operations. Firstly, it allows you to visualize how traffic is controlled, providing actionable insights that help optimize performance and troubleshoot issues promptly. Secondly, monitoring enhances security measures by providing valuable insights during investigations, ensuring that your gateway remains secure and resilient against threats. Implementing monitoring for your Application Gateway for Containers not only supports ongoing performance optimization but also strengthens your overall security posture by enabling proactive detection and response capabilities.
16
16
17
-
You can monitor Azure Application Gateway for Containers resources in the following ways. Refer to the diagram below.
17
+
You can monitor Azure Application Gateway for Containers resources in the following ways. Refer to the diagram.
18
18
-[Backend Health Metrics](../../application-gateway/for-containers/application-gateway-for-containers-metrics.md): ALB Controller's metric and backend health endpoints exposes several metrics and summary of backend health. The metrics endpoint enables exposure to Prometheus.
19
19
20
20
-[Metrics](../../application-gateway/for-containers/application-gateway-for-containers-metrics.md): Metrics and Activity Logs are exposed through Azure Monitor to monitor the performance of your Application Gateway for Containers deployments. The metrics contain numerical values in an ordered set of time-series data.
21
21
22
-
-[Diagnostic Logs](../../application-gateway/for-containers/diagnostics.md): Access Logs audit all requests made to Application Gateway for Containers and provides sevreal characteristics, such as the client's IP, requested URL, request/response latencies, return code, and bytes in and out. An access log is collected every 60 seconds.
22
+
-[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.
23
23
24
-
[](./media/prometheus-grafana/article.drawio.png#lightbox)
24
+
[](./media/prometheus-grafana/article-drawio.png#lightbox)
25
25
26
26
## Learn About the Services
27
27
-[What is Azure Managed Prometheus?](../../azure-monitor/essentials/prometheus-metrics-overview.md)
@@ -53,49 +53,52 @@ You can monitor Azure Application Gateway for Containers resources in the follow
53
53
Complete the steps to configure prometheus and grafana.
54
54
1. Sign in to the [Azure portal](https://portal.azure.com) with your Azure account.
55
55
2. In **Search resources, service, and docs**, type **Application Gateways for Containers** and select your Kubernetes Cluster name.
56
-
57
-

58
-
56
+
57
+
](./media/prometheus-grafana/configure.png#lightbox)
58
+
59
59
3. Under insights and select **Configure Monitoring**.
60
+
60
61

61
62
Create new instances of Log analytics, Azure Monitor (Prometheus), and Managed Grafana to store current Kubernetes cluster metrics.
62
63
4. In **Search resources, service, and docs**, type **Managed Prometheus** and select.
63
-

64
+
65
+
](./media/prometheus-grafana/managed-prometheus.png#lightbox)
66
+
64
67
5. Follow the steps to enable Azure Monitor to enable Managed Prometheus service by selecting **Create**.
65
-
6. Create Azure Monitor Workspace Instance:
66
-
- On the **Create** an Azure Monitor Workspace page, select a subscription and resource group.
67
-
-Provide a name and a region for the workspace.
68
-
-Select **Review + create** to create the workspace.
68
+
6. Create Azure Monitor Workspace Instance:
69
+
1. In the **Create** an Azure Monitor Workspace page, select a subscription and resource group.
70
+
2.Provide a name and a region for the workspace.
71
+
3.Select **Review + create** to create the workspace.
69
72
7. Add Prometheus Config Map to your cluster:
70
-
- Copy this file to notepad or Visual Studio Code: https://github.com/Azure/prometheus-collector/blob/main/otelcollector/configmaps/ama-metrics-settings-configmap.yaml.
71
-
-Modify line 35 to set podannotationnamespaceregex from “” to "azure-alb-system".
73
+
1. Copy this file to notepad or Visual Studio Code: https://github.com/Azure/prometheus-collector/blob/main/otelcollector/configmaps/ama-metrics-settings-configmap.yaml.
74
+
2.Modify line 35 to set podannotationnamespaceregex from “” to "azure-alb-system".
72
75
```Bash
73
76
# Example Kusto Query
74
77
podannotationnamespaceregex = "azure-alb-system"
75
78
```
76
-
- Save the file as configprometheus.yaml.
77
-
- Add file into CLI (command-line interfaces) under manage files.
78
-
- Run the following command:
79
+
3. Save the file as configprometheus.yaml.
80
+
4. Add file into CLI (command-line interfaces) under manage files.
81
+
5. Run the following command:
79
82
```Bash
80
83
# Run the Following Command in Bash
81
84
kubectl apply -f configprometheus.yaml
82
85
```
83
-
8. [Create a managed Grafana](../../managed-grafana/quickstart-managed-grafana-portal.md)
84
-
9. Link a Grafana Workspace:
86
+
8. [Create a managed Grafana](../../managed-grafana/quickstart-managed-grafana-portal.md).
87
+
Link a Grafana Workspace:
85
88
- In **Search resources, service, and docs**, type**Azure Monitor**.
86
89
- Select your monitor workspace.
87
90
- Select **Linked Grafana Workspaces**.
88
91

89
-
10. Select a Grafana workspace.
90
-
11. Select **Link**.
92
+
9. Select a Grafana workspace.
93
+
10. Select **Link**.
91
94
92
95
93
-
## Configure AKS cluster for logging
96
+
## Configure Kubernetes cluster for logging
94
97
We created the resources and now we combine all resources and configure prometheus.
95
98
96
-
1. Cluster Configuration
97
-
- In **Search resources, service, and docs**, search for your kubernetes cluster.
98
-
- Search for insights and Select on **Configure Monitoring**.
99
+
1. Cluster configuration
100
+
1. In **Search resources, service, and docs**, search for your kubernetes cluster.
101
+
2. Search for insights and Select on **Configure Monitoring**.
99
102
2. Specify each instance:
100
103
- Log analytics workspace: Use the default new log analytics workspace created for you.
101
104
- Managed Prometheus: Select on **“Enable Prometheus metrics”** checkbox.
@@ -104,18 +107,19 @@ We created the resources and now we combine all resources and configure promethe
104
107
- Select on advanced setting: specify the Grafana instance recently created.
105
108
- Select **“Configure”**.
106
109
> [!NOTE]
107
-
> Check forama-metrics under workloadsin your kubernetes cluster
108
-
>
109
-
110
+
> Check forama-metrics under workloadsin your kubernetes cluster.
111
+
>](./media/prometheus-grafana/notesimage.png#lightbox)
112
+
110
113
## Enable diagnostic logs for Application Gateway for Containers
111
114
Activity logging is automatically enabled forevery Resource Manager resource. For Access Logs, you must enable access logging to start collecting the data available through those logs. To enable logging, you may configure diagnostic settingsin Azure Monitor.
112
115
113
116
1. [Create a log analytics workspace](../../azure-monitor/logs/quick-create-workspace.md).
114
117
2. Send logs from Application Gateway for Containers to log analytics workspace:
115
-
- Enter **Application Gateway forContainers**in the search box. Select your active Application Gateway for Container resource.
116
-
- Search and selectDiagnostic Setting under Monitoring. Add diagnostic setting.
117
-
- Select a name, check box **allLogs** which includes the Application Gateway for Container Access Logs, and select**Send to Log analytics Workspace** with your desired subscription and recently made log analytics workspace.
118
-

118
+
1. Enter **Application Gateway forContainers**in the search box. Select your active Application Gateway for Container resource.
119
+
2. Search and selectDiagnostic Setting under Monitoring. Add diagnostic setting.
120
+
3. Select a name, check box **allLogs** which includes the Application Gateway for Container Access Logs, and select**Send to Log analytics Workspace** with your desired subscription and recently made log analytics workspace.
121
+
](./media/prometheus-grafana/logsall.png#lightbox)
122
+
119
123
3. Select **Save**.
120
124
121
125
## Access Grafana dashboard
@@ -126,8 +130,8 @@ In this section, we enter Grafana default dashboards.
126
130
3. Select on Endpoint URL in the overview.
127
131

128
132
129
-
5. After entering your user credentials, refer to the Grafana introduction.
130
-
6. Select on the left side bar to access default dashboards under dashboards.
133
+
4. After entering your user credentials, refer to the Grafana introduction.
134
+
5. Select on the left side bar to access default dashboards under dashboards.
131
135

132
136
133
137
## Graph Prometheus metrics on Grafana
@@ -138,14 +142,13 @@ In this section, we visualize a sample metric from Prometheus metrics. Refer to
138
142
2. Select **Add Visualization**.
139
143
3. Search for prometheus under data source.
140
144

141
-
4. Select desired metric. For Example: alb_controller_total_unhealthy_endpoints which gives any unhealthy endpoints of your backend service.
145
+
4. Select desired metric. For Example: alb_controller_total_unhealthy_endpoints that gives any unhealthy endpoints of your backend service.
142
146
5. Choose app as alb-controller.
143
147
6. Select name of the panel, type of visualization, and time range.
144
148

145
-
146
-
8. **Save + Apply** of your panel to add into your dashboard.
149
+
7. **Save + Apply** of your panel to add into your dashboard.
147
150
> [!NOTE]
148
-
> Add a custom legend by {{variable_name}}
151
+
> Add a custom legend by {{variable_name}}.
149
152
150
153
## Graph access logs and metrics on Grafana
151
154
@@ -159,11 +162,11 @@ In this section, we visualize a sample logs from Log Analytics Workspace. Refer
159
162

160
163
4. Change service as **Logs**.
161
164
5. Type:
162
-
```kusto
163
-
// Example Kusto Query
164
-
AGCAccessLogs
165
-
| project BackendResponseLatency, TimeGenerated
166
-
```
165
+
```kusto
166
+
// Example Kusto Query
167
+
AGCAccessLogs
168
+
| project BackendResponseLatency, TimeGenerated
169
+
```
167
170
6. Select a **Time Series** as a visualization.
168
171
7. Select name, description, and time range of the panel.
169
172

@@ -175,11 +178,11 @@ AGCAccessLogs
175
178
2. Select **Add Visualization**.
176
179
3. Search for Azure Monitor under data source+ **Add**.
177
180
4. Change service as Metrics.
178
-
5. Select your application gateway for containers instance.
179
-

181
+
5. Select your application gateway for containers instance.
182
+
](./media/prometheus-grafana/metrics-logs-datasource.png#lightbox)
180
183
6. Select metric namespace as microsoft.servicenetworking/trafficcontrollers.
181
184
7. Choose a metric such as **total requests** and type of data visualization.
182
-

185
+
](./media/prometheus-grafana/metrics-logs.png#lightbox)
183
186
8. Select a name, description, and time range of the panel.
0 commit comments