Skip to content

Commit 7b03219

Browse files
Merge pull request #216072 from kinghorn/patch-6
Update prometheus-remote-write-managed-identity.md
2 parents 3623916 + bcfedac commit 7b03219

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

articles/azure-monitor/essentials/prometheus-remote-write-managed-identity.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,44 @@ This step isn't required if you're using an AKS identity since it will already h
163163
```
164164
165165
166+
## Verify remote write is working correctly
167+
168+
You can verify that Prometheus data is being sent into your Azure Monitor workspace in a couple of ways.
169+
170+
1. By viewing your container log using kubectl commands:
171+
172+
```azurecli
173+
kubectl logs <Prometheus-Pod-Name> <Azure-Monitor-Side-Car-Container-Name>
174+
# example: kubectl logs prometheus-prometheus-kube-prometheus-prometheus-0 prom-remotewrite
175+
```
176+
Expected output: time="2022-10-19T22:11:58Z" level=info msg="Metric packets published in last 1 minute" avgBytesPerRequest=19809 avgRequestDuration=0.17153638698214294 failedPublishingToAll=0 successfullyPublishedToAll=112 successfullyPublishedToSome=0
177+
178+
You can confirm that the data is flowing via remote write if the above output has non-zero value for “avgBytesPerRequest” and “avgRequestDuration”.
179+
180+
2. By performing PromQL queries on the data and verifying results
181+
This can be done via Grafana. Refer to our documentation for [getting Grafana setup with Managed Prometheus](prometheus-grafana.md).
182+
183+
## Troubleshooting remote write setup
184+
185+
1. If the data is not flowing
186+
You can run the following commands to view errors from the container that cause the data not flowing.
187+
188+
```azurecli
189+
kubectl --namespace <Namespace> describe pod <Prometheus-Pod-Name>
190+
```
191+
These logs should indicate the errors if any in the remote write container.
192+
193+
2. If the container is restarting constantly
194+
This is likely due to misconfiguration of the container. In order to view the configuration values set for the container, run the following command:
195+
```azurecli
196+
kubectl get po <Prometheus-Pod-Name> -o json | jq -c '.spec.containers[] | select( .name | contains(" <Azure-Monitor-Side-Car-Container-Name> "))'
197+
```
198+
Output:
199+
{"env":[{"name":"INGESTION_URL","value":"https://rwtest-eus2-qu4m.eastus2-1.metrics.ingest.monitor.azure.com/dataCollectionRules/dcr-90b2d5e5feac43f486311dff33c3c116/streams/Microsoft-PrometheusMetrics/api/v1/write?api-version=2021-11-01-preview"},{"name":"LISTENING_PORT","value":"8081"},{"name":"IDENTITY_TYPE","value":"userAssigned"},{"name":"AZURE_CLIENT_ID","value":"fe9b242a-1cdb-4d30-86e4-14e432f326de"}],"image":"mcr.microsoft.com/azuremonitor/prometheus/promdev/prom-remotewrite:prom-remotewrite-20221012.2","imagePullPolicy":"Always","name":"prom-remotewrite","ports":[{"containerPort":8081,"name":"rw-port","protocol":"TCP"}],"resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","volumeMounts":[{"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount","name":"kube-api-access-vbr9d","readOnly":true}]}
200+
201+
Verify the configuration values especially “AZURE_CLIENT_ID” and “IDENTITY_TYPE”
166202
167203
## Next steps
168204
205+
= [Setup Grafana to use Managed Prometheus as a data source](prometheus-grafana.md).
169206
- [Learn more about Azure Monitor managed service for Prometheus](prometheus-metrics-overview.md).

0 commit comments

Comments
 (0)