Skip to content

Commit a147b0c

Browse files
authored
Update prometheus-grafana.md
1 parent 1805f3a commit a147b0c

File tree

1 file changed

+49
-46
lines changed

1 file changed

+49
-46
lines changed

articles/application-gateway/for-containers/prometheus-grafana.md

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ ms.author: greglin
1212

1313
# Configure Application Gateway for Containers for Prometheus and Grafana
1414

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.
1616

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.
1818
- [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.
1919

2020
- [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.
2121

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.
2323

24-
[![A screenshot of architecture grid.](./media/prometheus-grafana/article.drawio.png)](./media/prometheus-grafana/article.drawio.png#lightbox)
24+
[![A screenshot of architecture grid.](./media/prometheus-grafana/article-drawio.png)](./media/prometheus-grafana/article-drawio.png#lightbox)
2525

2626
## Learn About the Services
2727
- [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
5353
Complete the steps to configure prometheus and grafana.
5454
1. Sign in to the [Azure portal](https://portal.azure.com) with your Azure account.
5555
2. In **Search resources, service, and docs**, type **Application Gateways for Containers** and select your Kubernetes Cluster name.
56-
57-
![A screenshot of kubernetes insights.](./media/prometheus-grafana/configure.png)
58-
56+
57+
![[A screenshot of kubernetes insights.](./media/prometheus-grafana/configure.png)](./media/prometheus-grafana/configure.png#lightbox)
58+
5959
3. Under insights and select **Configure Monitoring**.
60+
6061
![A screenshot of monitoring metrics.](./media/prometheus-grafana/grafanacontainer.png)
6162
Create new instances of Log analytics, Azure Monitor (Prometheus), and Managed Grafana to store current Kubernetes cluster metrics.
6263
4. In **Search resources, service, and docs**, type **Managed Prometheus** and select.
63-
![A screenshot of Prometheus Managed.](./media/prometheus-grafana/managed-prometheus.png)
64+
65+
![[A screenshot of Prometheus Managed.](./media/prometheus-grafana/managed-prometheus.png)](./media/prometheus-grafana/managed-prometheus.png#lightbox)
66+
6467
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.
6972
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".
7275
```Bash
7376
# Example Kusto Query
7477
podannotationnamespaceregex = "azure-alb-system"
7578
```
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:
7982
```Bash
8083
# Run the Following Command in Bash
8184
kubectl apply -f configprometheus.yaml
8285
```
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:
8588
- In **Search resources, service, and docs**, type **Azure Monitor**.
8689
- Select your monitor workspace.
8790
- Select **Linked Grafana Workspaces**.
8891
![A screenshot of Grafana Link.](./media/prometheus-grafana/gwork.png)
89-
10. Select a Grafana workspace.
90-
11. Select **Link**.
92+
9. Select a Grafana workspace.
93+
10. Select **Link**.
9194

9295

93-
## Configure AKS cluster for logging
96+
## Configure Kubernetes cluster for logging
9497
We created the resources and now we combine all resources and configure prometheus.
9598

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**.
99102
2. Specify each instance:
100103
- Log analytics workspace: Use the default new log analytics workspace created for you.
101104
- 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
104107
- Select on advanced setting: specify the Grafana instance recently created.
105108
- Select **“Configure”**.
106109
> [!NOTE]
107-
> Check for ama-metrics under workloads in your kubernetes cluster
108-
> ![A screenshot of Checking Config.](./media/prometheus-grafana/notesimage.png)
109-
110+
> Check for ama-metrics under workloads in your kubernetes cluster.
111+
> ![[A screenshot of Checking Config.](./media/prometheus-grafana/notesimage.png)](./media/prometheus-grafana/notesimage.png#lightbox)
112+
110113
## Enable diagnostic logs for Application Gateway for Containers
111114
Activity logging is automatically enabled for every 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 settings in Azure Monitor.
112115

113116
1. [Create a log analytics workspace](../../azure-monitor/logs/quick-create-workspace.md).
114117
2. Send logs from Application Gateway for Containers to log analytics workspace:
115-
- Enter **Application Gateway for Containers** in the search box. Select your active Application Gateway for Container resource.
116-
- Search and select Diagnostic 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-
![A screenshot of Application Gateway for Containers Diagnostic Setting.](./media/prometheus-grafana/logsall.png)
118+
1. Enter **Application Gateway for Containers** in the search box. Select your active Application Gateway for Container resource.
119+
2. Search and select Diagnostic 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+
![[A screenshot of Application Gateway for Containers Diagnostic Setting.](./media/prometheus-grafana/logsall.png)](./media/prometheus-grafana/logsall.png#lightbox)
122+
119123
3. Select **Save**.
120124

121125
## Access Grafana dashboard
@@ -126,8 +130,8 @@ In this section, we enter Grafana default dashboards.
126130
3. Select on Endpoint URL in the overview.
127131
![A screenshot of Grafana Endpoint.](./media/prometheus-grafana/grafaend.png)
128132

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.
131135
![A screenshot of Dafault Grafana Dashboard.](./media/prometheus-grafana/grafana-default.png)
132136

133137
## Graph Prometheus metrics on Grafana
@@ -138,14 +142,13 @@ In this section, we visualize a sample metric from Prometheus metrics. Refer to
138142
2. Select **Add Visualization**.
139143
3. Search for prometheus under data source.
140144
![A screenshot of Data Source Prometheus Dashboard.](./media/prometheus-grafana/data-source-prometheus.png)
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.
142146
5. Choose app as alb-controller.
143147
6. Select name of the panel, type of visualization, and time range.
144148
![A screenshot of Prometheus Logging Test.](./media/prometheus-grafana/prometheus-grafana-viewing.png)
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.
147150
> [!NOTE]
148-
> Add a custom legend by {{variable_name}}
151+
> Add a custom legend by {{variable_name}}.
149152

150153
## Graph access logs and metrics on Grafana
151154

@@ -159,11 +162,11 @@ In this section, we visualize a sample logs from Log Analytics Workspace. Refer
159162
![A screenshot of Log Data Source.](./media/prometheus-grafana/log-data-source.png)
160163
4. Change service as **Logs**.
161164
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+
```
167170
6. Select a **Time Series** as a visualization.
168171
7. Select name, description, and time range of the panel.
169172
![A screenshot of Application Gateway for Containers Logging Example.](./media/prometheus-grafana/logging-example.png)
@@ -175,11 +178,11 @@ AGCAccessLogs
175178
2. Select **Add Visualization**.
176179
3. Search for Azure Monitor under data source+ **Add**.
177180
4. Change service as Metrics.
178-
5. Select your application gateway for containers instance.
179-
![A screenshot of Metrics Log Data Source.](./media/prometheus-grafana/metrics-logs-datasource.png)
181+
5. Select your application gateway for containers instance.
182+
![[A screenshot of Metrics Log Data Source.](./media/prometheus-grafana/metrics-logs-datasource.png)](./media/prometheus-grafana/metrics-logs-datasource.png#lightbox)
180183
6. Select metric namespace as microsoft.servicenetworking/trafficcontrollers.
181184
7. Choose a metric such as **total requests** and type of data visualization.
182-
![A screenshot of Example Metrics Log Data Source.](./media/prometheus-grafana/metrics-logs.png)
185+
![[A screenshot of Example Metrics Log Data Source.](./media/prometheus-grafana/metrics-logs.png)](./media/prometheus-grafana/metrics-logs.png#lightbox)
183186
8. Select a name, description, and time range of the panel.
184187
9. **Save + Apply** to your dashboard.
185188

0 commit comments

Comments
 (0)