Query Metrics
GET/admin_api/v1/metrics/api/v1/query
Evaluates a PromQL expression at one instant (time, RFC 3339 or unix seconds, default now), as GET /api/v1/query on a Prometheus server does (this API is Prometheus-compatible). Supported PromQL: selectors with = != =~ !~ and offset; rate increase delta resets avg_over_time sum_over_time count_over_time min_over_time max_over_time last_over_time present_over_time; abs ceil floor round sqrt exp ln log2 log10 clamp clamp_min clamp_max scalar vector time sort sort_desc absent label_replace label_join; sum avg min max count stddev stdvar group topk bottomk with by/without; arithmetic, comparison (bool) and and or unless with on/ignoring, group_left/group_right. Regular expressions are RE2, as in Prometheus. Scope with {project_id="…"}, {organization_id="…"} or {resource_id="…"}, or a list of ids as {resource_id=~"id1|id2|id3"}; a selection over the series limit (1000) is refused with a hint. To cover more, page the resource ids from /usage and select each page by resource_id=~.
Also accepts POST, with the same parameters in an application/x-www-form-urlencoded body, for requests too long for a URL.
Request
Responses
- 200
OK