Skip to content

Commit 25a6679

Browse files
committed
draft 2
1 parent 12fbc88 commit 25a6679

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed
0 Bytes
Loading
67.5 KB
Loading
97.6 KB
Loading

articles/azure-monitor/essentials/query-azure-monitor-workspaces.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,33 @@ Save the access token from the response for use in the following HTTP requests.
105105

106106
## Query Endpoints
107107

108-
Two endpoints are supported for querying Azure Monitor workspaces:
109-
+ The Azure monitor workspace query endpoint, using POST
110-
For example:
111-
POST: Query endpoint from the over view page
112-
https://k8s02-workspace-abcd.eastus.prometheus.monitor.azure.com/api/v1/query
113-
114-
+ The Azure management endpoint using GET.
115-
108+
### GET/query
109+
116110
```
117-
GET https://management.azure.com/subscriptions/<subscriptionId>/resourcegroups/<resourceGroupName>/providers/microsoft.monitor/accounts/<amwName>?api-version=2021-06-01-preview
111+
GET https://management.azure.com/subscriptions/<subscriptionId>/resourcegroups/<resourceGroupName>/providers/microsoft.monitor/accounts/<workspace name>/api/v1/label/__name__/values?api-version=2021-06-01-preview
112+
--header 'Authorization: Bearer <access token>'
118113
```
114+
When using the management end point, request a token using `--data-urlencode 'resource= https://management.azure.com'`
115+
116+
### POST / query
117+
118+
POST uses the Azure Monitor workspace query endpoint
119119

120-
When using the management end point, request a token using `--data-urlencode 'resource= https://management.azure.com'` instead of `prometheus.monitor.azure.com`
120+
```http
121+
https://k8s-02-workspace-abcd.eastus.prometheus.monitor.azure.com/api/v1/query
122+
123+
--header 'Authorization: Bearer <access token>'
124+
--header 'Content-Type: application/x-www-form-urlencoded'
125+
--data-urlencode 'query=sum(
126+
container_memory_working_set_bytes
127+
* on(namespace,pod)
128+
group_left(workload, workload_type) namespace_workload_pod:kube_pod_owner:relabel{ workload_type="deployment"}) by (pod)'
129+
130+
```
131+
When using the Azure Monitor workspace query endpoint, request a token using `--data-urlencode 'resource= https://prometheus.monitor.azure.com'`
121132

133+
Find your workspace's query endpoint on the overview page.
134+
:::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 endpoin on the Azure Monitor workspace overview page.":::
122135
## Supported APIs
123136
The following queries are supported:
124137

0 commit comments

Comments
 (0)