Skip to content

Commit 0094ae3

Browse files
authored
Merge pull request #261427 from sunasing/sunasing-br-1215
Update Remote write documentation with AzureGovernment configuration
2 parents 4ee4729 + 6f0f8da commit 0094ae3

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed
657 KB
Loading

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,13 @@ The node resource group of the AKS cluster contains resources that you will requ
3030
## Get the client ID of the user assigned identity
3131
You will require the client ID of the identity that you're going to use. Note this value for use in later steps in this process.
3232

33-
Get the **Client ID** from the **Overview** page of your [managed identity](../../active-directory/managed-identities-azure-resources/how-manage-user-assigned-managed-identities.md).
34-
35-
:::image type="content" source="media/prometheus-remote-write-managed-identity/client-id.png" alt-text="Screenshot showing client ID on overview page of managed identity." lightbox="media/prometheus-remote-write-managed-identity/client-id.png":::
36-
37-
Instead of creating your own ID, you can use one of the identities created by AKS, which are listed in [Use a managed identity in Azure Kubernetes Service](../../aks/use-managed-identity.md). This article uses the `Kubelet` identity. The name of this identity is `<AKS-CLUSTER-NAME>-agentpool` and located in the node resource group of the AKS cluster.
33+
Instead of creating your own ID, you can use one of the identities created by AKS, which are listed in [Use a managed identity in Azure Kubernetes Service](../../aks/use-managed-identity.md). This article uses the `Kubelet` identity. The name of this identity is `<AKS-CLUSTER-NAME>-agentpool` and is located in the node resource group of the AKS cluster.
3834

3935
:::image type="content" source="media/prometheus-remote-write-managed-identity/resource-group-details.png" alt-text="Screenshot showing list of resources in the node resource group." lightbox="media/prometheus-remote-write-managed-identity/resource-group-details.png":::
4036

37+
Click on the `<AKS-CLUSTER-NAME>-agentpool` managed identity and copy the **Client ID** from the **Overview** page. To learn more about managed identity, visit [Managed Identity](../../active-directory/managed-identities-azure-resources/how-manage-user-assigned-managed-identities.md).
4138

39+
:::image type="content" source="media/prometheus-remote-write-managed-identity/client-id.png" alt-text="Screenshot showing client ID on overview page of managed identity." lightbox="media/prometheus-remote-write-managed-identity/client-id.png":::
4240

4341
## Assign Monitoring Metrics Publisher role on the data collection rule to the managed identity
4442
The managed identity requires the *Monitoring Metrics Publisher* role on the data collection rule associated with your Azure Monitor workspace.
@@ -84,7 +82,7 @@ This step isn't required if you're using an AKS identity since it will already h
8482
8583
## Deploy Side car and configure remote write on the Prometheus server
8684
87-
1. Copy the YAML below and save to a file. This YAML assumes you're using 8081 as your listening port. Modify that value if you use a different port.
85+
1. Copy the YAML below and save to a file. This YAML uses 8081 as the listening port but you can modify that value if you wish to use a different port.
8886
8987
[!INCLUDE[managed-identity-yaml](../includes/prometheus-sidecar-remote-write-managed-identity-yaml.md)]
9088
@@ -98,8 +96,11 @@ This step isn't required if you're using an AKS identity since it will already h
9896
| `<MANAGED-IDENTITY-CLIENT-ID>` | **Client ID** from the **Overview** page for the managed identity |
9997
| `<CLUSTER-NAME>` | Name of the cluster Prometheus is running on |
10098
99+
> [!IMPORTANT]
100+
> For Azure Government cloud, use *"https://monitor.azure.us//.default"* as the value for *INGESTION_AAD_AUDIENCE* in the yaml.
101+
101102
3. Open Azure Cloud Shell and upload the YAML file.
102-
4. Use helm to apply the YAML file to update your Prometheus configuration with the following CLI commands.
103+
4. Use helm to apply the YAML file to update your Prometheus configuration with the following CLI commands.
103104
104105
```azurecli
105106
# set context to your cluster

articles/azure-monitor/containers/prometheus-remote-write.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ Use the following methods to verify that Prometheus data is being sent into your
3434

3535
### kubectl commands
3636

37-
Use the following command to view your container log. Remote write data is flowing if the output has non-zero value for `avgBytesPerRequest` and `avgRequestDuration`.
37+
Use the following command to view logs from the side car container. Remote write data is flowing if the output has non-zero value for `avgBytesPerRequest` and `avgRequestDuration`.
3838

3939
```azurecli
40-
kubectl logs <Prometheus-Pod-Name> <Azure-Monitor-Side-Car-Container-Name>
41-
# example: kubectl logs prometheus-prometheus-kube-prometheus-prometheus-0 prom-remotewrite --namespace <namespace>
40+
kubectl logs <Prometheus-Pod-Name> <Azure-Monitor-Side-Car-Container-Name> --namespace <namespace-where-Prometheus-is-running>
41+
# example: kubectl logs prometheus-prometheus-kube-prometheus-prometheus-0 prom-remotewrite --namespace monitoring
4242
```
4343

4444
The output from this command should look similar to the following:
@@ -75,19 +75,21 @@ The output from this command should look similar to the following:
7575
```
7676

7777
### Hitting your ingestion quota limit
78-
With remote write you will typically get started using the remote write endpoint shown on the Azure Monitor workspace overview page. Behind the scenes, this uses a system Data Collection Rule (DCR) and system Data Collection Endpoint (DCE). These resources have an ingestion limit covered in the [Azure Monitor service limits](../service-limits.md#prometheus-metrics) document. You may hit these limits if you setup remote write for several clusters all sending data into the same endpoint in the same Azure Monitor workspace. If this is the case you can [create additional DCRs and DCEs](https://aka.ms/prometheus/remotewrite/dcrartifacts) and use them to spread out the ingestion loads across a few ingestion endpoints.
78+
With remote write you will typically get started using the remote write endpoint shown on the Azure Monitor workspace overview page. Behind the scenes, this uses a system Data Collection Rule (DCR) and system Data Collection Endpoint (DCE). These resources have an ingestion limit covered in the [Azure Monitor service limits](../service-limits.md#prometheus-metrics) document. You may hit these limits if you set up remote write for several clusters all sending data into the same endpoint in the same Azure Monitor workspace. If this is the case you can [create additional DCRs and DCEs](https://aka.ms/prometheus/remotewrite/dcrartifacts) and use them to spread out the ingestion loads across a few ingestion endpoints.
7979

8080
The INGESTION-URL uses the following format:
81-
https\://\<Metrics-Ingestion-URL>/dataCollectionRules/\<DCR-Immutable-ID>/streams/Microsoft-PrometheusMetrics/api/v1/write?api-version=2021-11-01-preview
81+
https\://\<**Metrics-Ingestion-URL**>/dataCollectionRules/\<**DCR-Immutable-ID**>/streams/Microsoft-PrometheusMetrics/api/v1/write?api-version=2021-11-01-preview
8282

83-
Metrics-Ingestion-URL: can be obtained by viewing DCE JSON body with API version 2021-09-01-preview or newer.
83+
**Metrics-Ingestion-URL**: can be obtained by viewing DCE JSON body with API version 2021-09-01-preview or newer. See screenshot below for reference.
8484

85-
DCR-Immutable-ID: can be obtained by viewing DCR JSON body or running the following command in the Azure CLI:
85+
:::image type="content" source="media/prometheus-remote-write-managed-identity/dce-ingestion-url.png" alt-text="Screenshot showing how to get the metrics ingestion URL." lightbox="media/prometheus-remote-write-managed-identity/dce-ingestion-url.png":::
86+
87+
**DCR-Immutable-ID**: can be obtained by viewing DCR JSON body or running the following command in the Azure CLI:
8688

8789
```azureccli
8890
az monitor data-collection rule show --name "myCollectionRule" --resource-group "myResourceGroup"
8991
```
90-
92+
9193
## Next steps
9294

9395
- [Learn more about Azure Monitor managed service for Prometheus](../essentials/prometheus-metrics-overview.md).

articles/azure-monitor/includes/prometheus-sidecar-remote-write-managed-identity-yaml.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ prometheus:
5959
value: userAssigned
6060
- name: AZURE_CLIENT_ID
6161
value: <MANAGED-IDENTITY-CLIENT-ID>
62+
- name: INGESTION_AAD_AUDIENCE
63+
value: https://monitor.azure.us//.default
6264
# Optional parameter
6365
- name: CLUSTER
6466
value: <CLUSTER-NAME>

0 commit comments

Comments
 (0)