v1

latestOpenAPI 3.0.32026-07-26191565482.4 KB
DerivedMetric

get/api/v1/config/derived-metrics

Query parameters

page.max_sizeinteger

Sets the preferred number of items to return per page. If set to 0, the server will use its default value. Regardless of the value specified, clients must never assume how many items will be returned.

page.tokenstring

An opaque page token that identifies which page the client should request. An empty value indicates the first page.

slugsstring[]

Filters results by slug, where any DerivedMetric with a matching slug in the given list (and matches all other filters) will be returned.

namesstring[]

Filters results by name, where any DerivedMetric with a matching name in the given list (and matches all other filters) will be returned.

Response

A successful response.

Example response

{
  "derived_metrics": [
    {
      "metric_name": "cpu_usage:instance",
      "queries": [
        {
          "query": {
            "prometheus_expr": "cpu_usage{$service, $instance} / sum(cpu_usage{$service})",
            "variables": [
              {
                "default_prometheus_selector": "service=~\".*\"",
                "name": "service"
              }
            ]
          }
        }
      ]
    }
  ]
}