{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/chronosphere/main/json-schema/chronosphere-configv1-create-derived-metric-response-schema.json", "title": "configv1CreateDerivedMetricResponse", "x-generated": "2026-10-03", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/chronosphere-derivedmetric-api-openapi.yml#/components/schemas/configv1CreateDerivedMetricResponse", "properties": { "derived_metric": { "$ref": "#/$defs/configv1DerivedMetric" } }, "type": "object", "$defs": { "DerivedMetricQuery": { "properties": { "prometheus_expr": { "description": "PromQL expression the derived metric executes. The expression should\ninclude all configured variables.", "type": "string" }, "variables": { "description": "Optional. Specifies the variables that can be used in the derived metric as\nlabel selectors.", "items": { "$ref": "#/$defs/DerivedMetricVariable" }, "type": "array" } }, "required": [ "prometheus_expr" ], "type": "object" }, "DerivedMetricSelector": { "properties": { "labels": { "description": "Labels that must match in the derived metric usage for the selector to match.", "items": { "$ref": "#/$defs/configv1DerivedMetricLabelMatcher" }, "type": "array" } }, "type": "object" }, "DerivedMetricSelectorQuery": { "properties": { "query": { "allOf": [ { "$ref": "#/$defs/DerivedMetricQuery" } ], "description": "The query to run when the selector matches." }, "selector": { "allOf": [ { "$ref": "#/$defs/DerivedMetricSelector" } ], "description": "Optional. Defines the selection criteria to select which query to use for the\ngiven derived metric. If selector is empty, then the corresponding query is\nthe default query used for the derived metric. Exactly one default query must\nbe configured." } }, "required": [ "query" ], "type": "object" }, "DerivedMetricVariable": { "properties": { "default_prometheus_selector": { "description": "PromQL label selector, which must match the given variable name. If the\nvariable is not specified in the derived metric usage, then the default\nselector is used.", "type": "string" }, "name": { "description": "Name of the variable.", "type": "string" } }, "required": [ "default_prometheus_selector", "name" ], "type": "object" }, "configv1DerivedMetric": { "properties": { "created_at": { "description": "Timestamp of when the DerivedMetric was created. Cannot be set by clients.", "format": "date-time", "readOnly": true, "type": "string" }, "description": { "description": "Optional. Description of the derived metric.", "type": "string" }, "metric_name": { "description": "Name of the derived metric, which must be unique across the system.", "type": "string" }, "name": { "description": "The name of the DerivedMetric. You can modify this value after the DerivedMetric is created.", "type": "string" }, "queries": { "description": "Defines the queries that the derived metric can map to.", "items": { "$ref": "#/$defs/DerivedMetricSelectorQuery" }, "type": "array" }, "slug": { "description": "The unique identifier of the DerivedMetric. If a `slug` isn't provided, one is generated based on the `name` field. You can't modify this field after the DerivedMetric is created.", "type": "string" }, "updated_at": { "description": "Timestamp of when the DerivedMetric was last updated. Cannot be set by clients.", "format": "date-time", "readOnly": true, "type": "string" } }, "required": [ "metric_name", "name", "queries" ], "type": "object" }, "configv1DerivedMetricLabelMatcher": { "properties": { "name": { "description": "name always matches against an exact label name.", "type": "string" }, "type": { "allOf": [ { "$ref": "#/$defs/configv1DerivedMetricLabelMatcherMatcherType" } ], "description": "type determines how the label value is matched." }, "value": { "description": "value matches against a label value based on the configured type.", "type": "string" } }, "type": "object" }, "configv1DerivedMetricLabelMatcherMatcherType": { "enum": [ "EXACT" ], "type": "string" } } }