Skip to content

Commit ddba53a

Browse files
Merge pull request #278757 from EdB-MSFT/self-managed-promehteus-remote-write
Configure remote write for self-managed Prometheus on a Kubernetes cluster
2 parents 5f12863 + 0281f54 commit ddba53a

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed

articles/azure-monitor/essentials/prometheus-remote-write-virtual-machines.md

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
---
2-
title: Send Prometheus metrics from Virtual Machines to an Azure Monitor workspace
2+
title: Send Prometheus metrics from virtual machines, scale sets, or Kubernetes clusters to an Azure Monitor workspace
33
description: How to configure remote-write to send data from self-managed Prometheus to an Azure Monitor managed service for Prometheus
4-
author: bwren
4+
author: EdB-MSFT
5+
ms.author: edbaynash
56
ms.topic: conceptual
67
ms.custom: devx-track-azurecli
7-
ms.date: 04/15/2024
8+
ms.date: 06/20/2024
89
#customer intent: As an azure administrator, I want to send Prometheus metrics from my self-managed Prometheus instance to an Azure Monitor workspace.
910
---
1011

11-
# Send Prometheus metrics from Virtual Machines to an Azure Monitor workspace
12+
# Send Prometheus metrics from virtual machines, scale sets, or Kubernetes clusters to an Azure Monitor workspace
1213

13-
Prometheus isn't limited to monitoring Kubernetes clusters. Use Prometheus to monitor applications and services running on your servers, wherever they're running. For example, you can monitor applications running on Virtual Machines, Virtual Machine Scale Sets, or even on-premises servers. Install prometheus on your servers and configure remote-write to send metrics to an Azure Monitor workspace.
14+
Prometheus isn't limited to monitoring Kubernetes clusters. Use Prometheus to monitor applications and services running on your servers, wherever they're running. For example, you can monitor applications running on Virtual Machines, Virtual Machine Scale Sets, or even on-premises servers. You can also send Prometheus metrics to an Azure Monitor workspace from your self-managed cluster and Prometheus server. Install prometheus on your servers and configure remote-write to send metrics to an Azure Monitor workspace.
1415

1516
This article explains how to configure remote-write to send data from a self-managed Prometheus instance to an Azure Monitor workspace.
1617

@@ -19,22 +20,24 @@ This article explains how to configure remote-write to send data from a self-man
1920

2021
Self-managed Prometheus can run on Azure and non-Azure environments. The following are authentication options for remote-write to Azure Monitor workspace based on the environment where Prometheus is running.
2122

22-
## Azure managed Virtual Machines and Virtual Machine Scale Sets
23+
## Azure-managed Virtual Machines, Virtual Machine Scale Sets, and Kubernetes clusters
2324

24-
Use user-assigned managed identity authentication for services running self managed Prometheus in an Azure environment. Azure managed services include:
25+
Use user-assigned managed identity authentication for services running self managed Prometheus in an Azure environment. Azure-managed services include:
2526

2627
- Azure Virtual Machines
2728
- Azure Virtual Machine Scale Sets
2829
- Azure Arc-enabled Virtual Machines
30+
- Azure Kubernetes Service (AKS)
2931

30-
To set up remote write for Azure managed resources, see [Remote-write using user-assigned managed identity](#remote-write-using-user-assigned-managed-identity-authentication).
32+
To set up remote write for Azure-managed resources, see [Remote-write using user-assigned managed identity](#remote-write-using-user-assigned-managed-identity-authentication).
3133

3234

33-
## Virtual machines running on non-Azure environments.
35+
## Virtual machines and Kubernetes clusters running on non-Azure environments.
3436

35-
Onboarding to Azure Arc-enabled services, allows you to manage and configure non-Azure virtual machines in Azure. Once onboarded, configure [Remote-write using user-assigned managed identity](#remote-write-using-user-assigned-managed-identity-authentication) authentication. For more Information on onboarding Virtual Machines to Azure Arc-enabled servers, see [Azure Arc-enabled servers](/azure/azure-arc/servers/overview).
37+
If you have virtual machines, or a Kubernetes cluster in non-Azure environments, and you don't want to onboard to Azure Arc, install self-managed Prometheus, and configure remote-write using Microsoft Entra ID application authentication. For more information, see [Remote-write using Microsoft Entra ID application authentication](#remote-write-using-microsoft-entra-id-application-authentication).
38+
39+
Onboarding to Azure Arc-enabled services allows you to manage and configure non-Azure virtual machines in Azure. Once onboarded, configure [Remote-write using user-assigned managed identity](#remote-write-using-user-assigned-managed-identity-authentication) authentication. For more Information on onboarding Virtual Machines to Azure Arc-enabled servers, see [Azure Arc-enabled servers](/azure/azure-arc/servers/overview) and [Azure Arc-enabled Kubernetes](/azure/azure-arc/kubernetes/overview).
3640

37-
If you have virtual machines in non-Azure environments, and you don't want to onboard to Azure Arc, install self-managed Prometheus and configure remote-write using Microsoft Entra ID application authentication. For more information, see [Remote-write using Microsoft Entra ID application authentication](#remote-write-using-microsoft-entra-id-application-authentication).
3841

3942
## Prerequisites
4043

@@ -57,8 +60,11 @@ Depending on the environment where Prometheus is running, you can configure remo
5760
Use the Azure portal or CLI to create a user-assigned managed identity or Microsoft Entra ID application.
5861

5962
### [Remote-write using user-assigned managed identity](#tab/managed-identity)
63+
6064
### Remote-write using user-assigned managed identity authentication
6165

66+
User-assigned managed identity authentication can be used in any Azure-managed environment. If your Prometheus service is running in a non-Azure environment, you can use Entra ID application authentication.
67+
6268
To configure a user-assigned managed identity for remote-write to Azure Monitor workspace, complete the following steps.
6369

6470
#### Create a user-assigned managed identity
@@ -69,7 +75,7 @@ Note the value of the `clientId` of the managed identity that you created. This
6975

7076
#### Assign the Monitoring Metrics Publisher role to the application
7177

72-
Assign the `Monitoring Metrics Publisher` role on the workspace's data collection rule to the managed identity.
78+
On the workspace's data collection rule, assign the `Monitoring Metrics Publisher` role to the managed identity.
7379

7480
1. On the Azure Monitor workspace Overview page, select the **Data collection rule** link.
7581

@@ -91,7 +97,7 @@ Assign the `Monitoring Metrics Publisher` role on the workspace's data collectio
9197

9298
:::image type="content" source="media/prometheus-remote-write-virtual-machines/select-members.png" lightbox="media/prometheus-remote-write-virtual-machines/select-members.png" alt-text="A screenshot showing the select members menu for a data collection rule.":::
9399

94-
#### Assign the managed identity to a Virtual Machine or Virtual Machine Scale Set.
100+
#### Assign the managed identity to a Virtual Machine or Virtual Machine Scale Set
95101

96102
> [!IMPORTANT]
97103
> To complete the steps in this section, you must have owner or user access administrator permissions for the Virtual Machine or Virtual MAchine Scale Set.
@@ -102,13 +108,23 @@ Assign the `Monitoring Metrics Publisher` role on the workspace's data collectio
102108
1. Select **Add**.
103109
1. Select the user assigned managed identity that you created, then select **Add**.
104110

105-
:::image type="content" source="media/prometheus-remote-write-virtual-machines/assign-user-identity.png" lightbox="media/prometheus-remote-write-virtual-machines/assign-user-identity.png" alt-text="A screenshot showing the Add user assigned managed identity page.":::
111+
:::image type="content" source="media/prometheus-remote-write-virtual-machines/assign-user-identity.png" lightbox="media/prometheus-remote-write-virtual-machines/assign-user-identity.png" alt-text="A screenshot showing the add user assigned managed identity page.":::
112+
113+
#### Assign the managed identity for an Azure Kubernetes Service
114+
115+
For Azure Kubernetes services (AKS), the managed identity must be assigned to the virtual machine scale sets.
116+
117+
AKS creates a resource group containing the virtual machine scale sets. The resource group name is in the format `MC_<resource group name>_<AKS cluster name>_<region>`.
118+
For each Virtual Machine Scale Set in the resource group, assign the managed identity according to the steps in the previous section, [Assign the managed identity to a Virtual Machine or Virtual Machine Scale Set](#assign-the-managed-identity-to-a-virtual-machine-or-virtual-machine-scale-set).
119+
106120

107121

108122
### [Microsoft Entra ID application](#tab/entra-application)
109123
### Remote-write using Microsoft Entra ID application authentication
110124

111-
To configure remote-write to Azure Monitor workspace using a Microsoft Entra ID application, create an Entra application and assign it the `Monitoring Metrics Publisher` role on the workspace's data collection rule to the application.
125+
Microsoft Entra ID application authentication can be used in any environment. If your Prometheus service is running in an Azure-managed environment consider using user-assigned managed identity authentication.
126+
127+
To configure remote-write to Azure Monitor workspace using a Microsoft Entra ID application, create an Entra application. On Azure Monitor workspace's data collection rule, assign the `Monitoring Metrics Publisher` role to the Entra application.
112128

113129
> [!NOTE]
114130
> Your Azure Entra application uses a client secret or password. Client secrets have an expiration date. Make sure to create a new client secret before it expires so you don't lose authenticated access
@@ -341,7 +357,7 @@ For more information, see [Prometheus explorer](/azure/azure-monitor/essentials/
341357

342358
### Grafana
343359

344-
Use PromQL queries in Grafana to verify that the results return the expected data. See [getting Grafana setup with Managed Prometheus](../essentials/prometheus-grafana.md) to configure Grafana.
360+
Use PromQL queries in Grafana to verify that the results return the expected data. To configure Grafana, see [getting Grafana setup with Managed Prometheus](../essentials/prometheus-grafana.md)
345361

346362

347363
## Troubleshoot remote write

0 commit comments

Comments
 (0)