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
group_left(workload, workload_type) namespace_workload_pod:kube_pod_owner:relabel{ workload_type="deployment"}) by (pod)'
118
+
--data-urlencode 'query=sum( \
119
+
container_memory_working_set_bytes \
120
+
* on(namespace,pod) \
121
+
group_left(workload, workload_type) \
122
+
namespace_workload_pod:kube_pod_owner:relabel{ workload_type="deployment"}) by (pod)'
122
123
123
124
```
124
125
```
125
-
GET https://k8s02-workspace-xy98.eastus.prometheus.monitor.azure.com/api/v1/query?api-version=2021-06-03-preview&query=container_memory_working_set_bytes'
126
+
GET 'https://k8s02-workspace-xy98.eastus.prometheus.monitor.azure.com/api/v1/query?query=container_memory_working_set_bytes'
126
127
--header 'Authorization: Bearer <access token>'
127
128
```
128
129
### Range queries
129
130
For more information, see [Range queries](https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries)
130
131
Path: `/api/v1/query_range`
131
132
Examples:
132
133
```
133
-
GET 'https://k8s02-workspace-xy98.eastus.prometheus.monitor.azure.com/api/v1/query_range?api-version=2021-06-03-preview&query=container_memory_working_set_bytes&start=2023-03-01T20%3A10%3A30.781Z&end=2023-03-20T20%3A11%3A00.781Z&step=6h' \
134
+
GET 'https://k8s02-workspace-xy98.eastus.prometheus.monitor.azure.com/api/v1/query_range?query=container_memory_working_set_bytes&start=2023-03-01T00:00:00.000Z&end=2023-03-20T00:00:00.000Z&step=6h'
134
135
--header 'Authorization: Bearer <access token>
135
136
```
136
137
137
138
```
138
-
POST 'https://k8s02-workspace-xy98.eastus.prometheus.monitor.azure.com/api/v1/query_range?api-version=2021-06-03-preview'
139
+
POST 'https://k8s02-workspace-xy98.eastus.prometheus.monitor.azure.com/api/v1/query_range'
GET 'https://k8s02-workspace-xy98.eastus.prometheus.monitor.azure.com/api/v1/series?api-version=2021-06-03-preview&match[]=container_network_receive_bytes_total&match[]=kube_pod_info{pod="bestapp-123abc456d-4nmfm"}'
160
+
GET 'https://k8s02-workspace-xy98.eastus.prometheus.monitor.azure.com/api/v1/series?match[]=container_network_receive_bytes_total{namespace="default-1669648428598"}'
162
161
```
163
162
164
163
### Labels
@@ -167,44 +166,46 @@ For more information, see [Labels](https://prometheus.io/docs/prometheus/latest/
167
166
Path: `/api/v1/labels`
168
167
Examples:
169
168
```
170
-
GET 'https://k8s02-workspace-xy98.eastus.prometheus.monitor.azure.com/api/v1/labels?api-version=2021-06-03-preview'
169
+
GET 'https://k8s02-workspace-xy98.eastus.prometheus.monitor.azure.com/api/v1/labels'
POST 'https://k8s02-workspace-xy98.eastus.prometheus.monitor.azure.com/api/v1/labels'
177
174
```
178
175
179
176
### Label values
180
177
For more information, see [Label values](https://prometheus.io/docs/prometheus/latest/querying/api/#query.ing-label-values)
181
-
Path: `/api/v1/label/\_\_name\_\_/values.`
178
+
Path: `/api/v1/label/__name__/values.`
182
179
183
180
184
181
> [!NOTE]
185
182
> `__name__` is the only supported version of this API and returns all metric names. No other /api/v1/label/<label_name>/values are supported.
186
183
187
184
Example:
188
185
```
189
-
GET 'https://k8s02-workspace-xy98.eastus.prometheus.monitor.azure.com/api/v1/label/__name__/values?api-version=2021-06-03-preview'
186
+
GET 'https://k8s02-workspace-xy98.eastus.prometheus.monitor.azure.com/api/v1/label/__name__/values'
190
187
```
191
188
192
189
For the full specification of OSS prom APIs, see [Prometheus HTTP API](https://prometheus.io/docs/prometheus/latest/querying/api/#http-api)
193
190
194
191
## API limitations
195
192
(differing from prom specification)
196
193
+ Query must be scoped to metric
197
-
Any time series fetch queries (/series or /query or /query_range) must contain name label matcher. That is, each query must be scoped to a metric. There can only be one name label matcher in a query.
194
+
Any time series fetch queries (/series or /query or /query_range) must contain \_\_name\_\_ label matcher. That is, each query must be scoped to a metric. There can only be one \_\_name\_\_ label matcher in a query.
198
195
+ Supported time range
199
196
+ /query_range API supports a time range of 32 days. This is the maximum time range allowed including range selectors specified in the query itself.
200
-
For example, the query `rate(http_requests_total[5m]` for last 24 hours would actually mean data is being queried for 25 hours. A 24 hours range + 1 hour specified in query itself.
201
-
+ /series API fetches data for a maximum 12-hour time range. If `endTime` isn't provided, endTime = time.now(). If yhr time rage is greater than 12 hours, the `startTime` is set to `endTime – 12h`
197
+
For example, the query `rate(http_requests_total[1h]` for last 24 hours would actually mean data is being queried for 25 hours. A 24 hours range + 1 hour specified in query itself.
198
+
+ /series API fetches data for a maximum 12-hour time range. If `endTime` isn't provided, endTime = time.now(). If the time rage is greater than 12 hours, the `startTime` is set to `endTime – 12h`
202
199
+ Ignored time range
203
-
Start time and end time provided with /labels and /label/name/values are ignored, and all retained data in the Azure Monitor Workspace is queried.
200
+
Start time and end time provided with `/labels` and `/label/__name__/values` are ignored, and all retained data in the Azure Monitor Workspace is queried.
204
201
+ Experimental features
205
202
Experimental features such as exemplars aren't supported.
206
203
207
204
For more information on Prometheus metrics limits, see [Prometheus metrics](../../azure-monitor/service-limits.md#prometheus-metrics)
208
205
209
-
>[!NOTE]
210
-
> Some of the limits can be increased. Please contact [PromWebApi](mailto:[email protected]) to request an increase for these limits on your Azure Monitor workspace.
0 commit comments