Skip to main content
POST
/
api
/
v1
/
config
/
derived-metrics
{
  "derived_metric": {
    "metric_name": "cpu_usage:instance",
    "name": "<string>",
    "queries": [
      {
        "query": {
          "prometheus_expr": "cpu_usage{$service, $instance} / sum(cpu_usage{$service})",
          "variables": [
            {
              "default_prometheus_selector": "service=~\".*\"",
              "name": "service"
            }
          ]
        },
        "selector": {
          "labels": [
            {
              "name": "<string>",
              "type": "EXACT",
              "value": "<string>"
            }
          ]
        }
      }
    ],
    "created_at": "2023-11-07T05:31:56Z",
    "description": "<string>",
    "slug": "<string>",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

API-Token
string
header
required

Chronosphere API token

Body

application/json
derived_metric
object

The DerivedMetric to create.

dry_run
boolean

If true, validates the specified configuration without creating the DerivedMetric. If the specified configuration is valid, the endpoint returns a partial response without the DerivedMetric. If the specified configuration is invalid, the endpoint returns an error.

Response

A successful response containing the created DerivedMetric.

derived_metric
object