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/azure-monitor/essentials/prometheus-remote-write-virtual-machines.md
+63-3Lines changed: 63 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,11 +47,12 @@ Onboarding to Azure Arc-enabled services allows you to manage and configure non-
47
47
- Prometheus versions greater than v2.48 are required for Microsoft Entra ID application authentication.
48
48
49
49
### Azure Monitor workspace
50
+
50
51
This article covers sending Prometheus metrics to an Azure Monitor workspace. To create an Azure monitor workspace, see [Manage an Azure Monitor workspace](./azure-monitor-workspace-manage.md#create-an-azure-monitor-workspace).
51
52
52
53
## Permissions
53
-
Administrator permissions for the cluster or resource are required to complete the steps in this article.
54
54
55
+
Administrator permissions for the cluster or resource are required to complete the steps in this article.
55
56
56
57
## Set up authentication for remote-write
57
58
@@ -289,13 +290,70 @@ The output contains the `appId` and `password` values. Save these values to use
289
290
For more information, see [az ad app create](/cli/azure/ad/app#az-ad-app-create) and [az ad sp create-for-rbac](/cli/azure/ad/sp#az-ad-sp-create-for-rbac).
290
291
291
292
---
293
+
292
294
## Configure remote-write
293
295
294
-
Remote-write is configured in the Prometheus configuration file `prometheus.yml`.
296
+
Remote-write is configured in the Prometheus configuration file `prometheus.yml`, or in the Prometheus Operator.
295
297
296
298
For more information on configuring remote-write, see the Prometheus.io article: [Configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write). For more on tuning the remote write configuration, see [Remote write tuning](https://prometheus.io/docs/practices/remote_write/#remote-write-tuning).
297
299
298
-
To send data to your Azure Monitor Workspace, add the following section to the configuration file of your self-managed Prometheus instance.
300
+
### [Configure remote-write for Prometheus Operator](#tab/prom-operator)
301
+
302
+
If you are running Prometheus Operator on a Kubernetes cluster, follow the below steps to send data to your Azure Monitor Workspace.
303
+
304
+
1. If you are using Microsoft Entra ID authentication, convert the secret using base64 encoding, and then apply the secret into your Kubernetes cluster. Save the following into a yaml file. Skip this step if you are using managed identity authentication.
305
+
306
+
```yaml
307
+
apiVersion: v1
308
+
kind: Secret
309
+
metadata:
310
+
name: remote-write-secret
311
+
namespace: monitoring # Replace with namespace where Prometheus Operator is deployed.
312
+
type: Opaque
313
+
data:
314
+
password: <base64-encoded-secret>
315
+
316
+
```
317
+
318
+
Apply the secret.
319
+
320
+
```azurecli
321
+
# set context to your cluster
322
+
az aks get-credentials -g <aks-rg-name> -n <aks-cluster-name>
323
+
324
+
kubectl apply -f <remote-write-secret.yaml>
325
+
```
326
+
327
+
1. You will need to update the values for remote write section in Prometheus Operator. Copy the following and save it as a yaml file. For the values of the yaml file, see below section. Refer to [Prometheus Operator documentation](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#azuread) for more details on the Azure Monitor Workspace remote write specification in Prometheus Operator.
328
+
329
+
```yaml
330
+
prometheus:
331
+
prometheusSpec:
332
+
remoteWrite:
333
+
- url: "<metrics ingestion endpoint for your Azure Monitor workspace>"
334
+
azureAd:
335
+
# AzureAD configuration.
336
+
# The Azure Cloud. Options are 'AzurePublic', 'AzureChina', or 'AzureGovernment'.
337
+
cloud: 'AzurePublic'
338
+
managedIdentity:
339
+
clientId: "<clientId of the managed identity>"
340
+
oauth:
341
+
clientId: "<clientId of the Entra app>"
342
+
clientSecret:
343
+
name: remote-write-secret
344
+
key: password
345
+
tenantId: "<Azure subscription tenant Id>"
346
+
```
347
+
348
+
1. Use helm to update your remote write config using the above yaml file.
349
+
350
+
```azurecli
351
+
helm upgrade -f <YAML-FILENAME>.yml prometheus prometheus-community/kube-prometheus-stack --namespace <namespace where Prometheus Operator is deployed>
352
+
```
353
+
354
+
### [Configure remote-write for Prometheus running in VMs or other environments](#tab/prom-vm)
355
+
356
+
To send data to your Azure Monitor Workspace, add the following section to the configuration file (prometheus.yml) of your self-managed Prometheus instance.
299
357
300
358
```yaml
301
359
remote_write:
@@ -312,6 +370,8 @@ remote_write:
312
370
tenant_id: "<Azure subscription tenant Id>"
313
371
```
314
372
373
+
---
374
+
315
375
The `url` parameter specifies the metrics ingestion endpoint of the Azure Monitor workspace. It can be found on the Overview page of your Azure Monitor workspace in the Azure portal.
316
376
317
377
:::image type="content" source="media/prometheus-remote-write-virtual-machines/metrics-ingestion-endpoint.png" lightbox="media/prometheus-remote-write-virtual-machines/metrics-ingestion-endpoint.png" alt-text="A screenshot showing the metrics ingestion endpoint for an Azure Monitor workspace.":::
0 commit comments