|
1 | 1 | ---
|
2 |
| -title: Query metrics in an Azure Monitor workspace using PromQL |
3 |
| -description: Describes how to Query metrics in an Azure Monitor workspace using PromQL. |
| 2 | +title: Query Prometheus metrics using the API and PromQL |
| 3 | +description: Describes how to use the API to Query metrics in an Azure Monitor workspace using PromQL. |
4 | 4 | ms.topic: how-to
|
5 | 5 | author: EdB-MSFT
|
6 | 6 | ms.author: edbaynash
|
7 | 7 | ms.date: 09/28/2022
|
8 | 8 | ms.reviewer: aul
|
9 | 9 | ---
|
10 | 10 |
|
11 |
| -# Query Prometheus metrics from an Azure Monitor Workspace using PromQL. |
| 11 | +# Query Prometheus metrics using the API and PromQL. |
12 | 12 |
|
13 | 13 | Azure Monitor managed service for Prometheus (preview), collects metrics from Azure Kubernetes Clusters and stores them in an Azure Monitor workspace. PromQL - Prometheus query language, is a functional query language that allows you to query and aggregate time series data. Use PromQL to query and aggregate metrics stored in an Azure Monitor workspace.
|
14 | 14 |
|
15 |
| -This article describes how to query an Azure Monitor workspace using PromQL via REST API. |
| 15 | +This article describes how to query an Azure Monitor workspace using PromQL via the REST API. |
16 | 16 | For more information on PromQL, see [Querying prometheus](https://prometheus.io/docs/prometheus/latest/querying/basics/).
|
17 | 17 |
|
18 | 18 | ## Prerequisites
|
@@ -46,24 +46,25 @@ Allow your app to query data from your Azure Monitor workspace.
|
46 | 46 |
|
47 | 47 | 1. Select Access control (IAM).
|
48 | 48 |
|
49 |
| -1. Select **Add**, then **Add role assignment** from the Access Control (IAM) page. |
50 |
| - :::image type="content" source="./media/query-azure-monitor-workspaces/access-control.png" lightbox="./media/query-azure-monitor-workspaces/access-control.png" alt-text="A screenshot showing the Azure Monitor workspace overview page"::: |
| 49 | +1. Select **Add**, then **Add role assignment** from the Access Control (IAM) page. |
| 50 | + |
| 51 | + :::image type="content" source="./media/prometheus-api-promql/access-control.png" lightbox="./media/prometheus-api-promql/access-control.png" alt-text="A screenshot showing the Azure Monitor workspace overview page"::: |
51 | 52 |
|
52 | 53 | 1. On the **Add role Assignment page**, search for *Monitoring*.
|
53 | 54 |
|
54 | 55 | 1. Select **Monitoring Data Reader**, then select the Members tab.
|
55 | 56 |
|
56 |
| - :::image type="content" source="./media/query-azure-monitor-workspaces/add-role-assignment.png" lightbox="./media/query-azure-monitor-workspaces/add-role-assignment.png" alt-text="A screenshot showing the Add role assignment page"::: |
| 57 | + :::image type="content" source="./media/prometheus-api-promql/add-role-assignment.png" lightbox="./media/prometheus-api-promql/add-role-assignment.png" alt-text="A screenshot showing the Add role assignment page"::: |
57 | 58 |
|
58 | 59 | 1. Select **Select members**.
|
59 | 60 |
|
60 |
| -1. Search for the app that you registered in the Register an app with Azure Active Directory section and select it. |
| 61 | +1. Search for the app that you registered and select it. |
61 | 62 |
|
62 | 63 | 1. Choose **Select**.
|
63 | 64 |
|
64 | 65 | 1. Select **Review + assign**.
|
65 | 66 |
|
66 |
| - :::image type="content" source="./media/query-azure-monitor-workspaces/select-members.png" lightbox="./media/query-azure-monitor-workspaces/select-members.png.png" alt-text="A screenshot showing the Add role assignment, select members page."::: |
| 67 | + :::image type="content" source="./media/prometheus-api-promql/select-members.png" lightbox="./media/prometheus-api-promql/select-members.png" alt-text="A screenshot showing the Add role assignment, select members page."::: |
67 | 68 |
|
68 | 69 | You've created your App registration and have assigned it access to query data from your Azure Monitor workspace. You can now generate a token and use it in a query.
|
69 | 70 |
|
@@ -98,8 +99,9 @@ Save the access token from the response for use in the following HTTP requests.
|
98 | 99 |
|
99 | 100 | ## Query Endpoint
|
100 | 101 |
|
101 |
| -Find your workspace's query endpoint on the overview page. |
102 |
| -:::image type="content" source="./media/query-azure-monitor-workspaces/find-query-endpoint.png" lightbox="./media/query-azure-monitor-workspaces/find-query-endpoint.png" alt-text="A screenshot sowing the query endpoint on the Azure Monitor workspace overview page."::: |
| 102 | +Find your workspace's query endpoint on the Azure Monitor workspace overview page. |
| 103 | + |
| 104 | +:::image type="content" source="./media/prometheus-api-promql/find-query-endpoint.png" lightbox="./media/prometheus-api-promql/find-query-endpoint.png" alt-text="A screenshot sowing the query endpoint on the Azure Monitor workspace overview page."::: |
103 | 105 |
|
104 | 106 | ## Supported APIs
|
105 | 107 | The following queries are supported:
|
|
0 commit comments