{
"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"
}
}{
"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"
}
}Chronosphere API token
If true, the DerivedMetric will be created if it does not already exist, identified by slug. If false, an error will be returned if the DerivedMetric does not already exist.
The DerivedMetric to update.
Show child attributes
Name of the derived metric, which must be unique across the system.
"cpu_usage:instance"
The name of the DerivedMetric. You can modify this value after the DerivedMetric is created.
Defines the queries that the derived metric can map to.
Show child attributes
The query to run when the selector matches.
Show child attributes
PromQL expression the derived metric executes. The expression should include all configured variables.
"cpu_usage{$service, $instance} / sum(cpu_usage{$service})"
Optional. Specifies the variables that can be used in the derived metric as label selectors.
Show child attributes
PromQL label selector, which must match the given variable name. If the variable is not specified in the derived metric usage, then the default selector is used.
"service=~\".*\""
Name of the variable.
"service"
Optional. Defines the selection criteria to select which query to use for the given derived metric. If selector is empty, then the corresponding query is the default query used for the derived metric. Exactly one default query must be configured.
Show child attributes
Labels that must match in the derived metric usage for the selector to match.
Show child attributes
name always matches against an exact label name.
type determines how the label value is matched.
EXACT value matches against a label value based on the configured type.
Optional. Description of the derived metric.
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.
If true, validates the specified configuration without creating or updating 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.
A successful response containing the updated DerivedMetric.
Show child attributes
Name of the derived metric, which must be unique across the system.
"cpu_usage:instance"
The name of the DerivedMetric. You can modify this value after the DerivedMetric is created.
Defines the queries that the derived metric can map to.
Show child attributes
The query to run when the selector matches.
Show child attributes
PromQL expression the derived metric executes. The expression should include all configured variables.
"cpu_usage{$service, $instance} / sum(cpu_usage{$service})"
Optional. Specifies the variables that can be used in the derived metric as label selectors.
Show child attributes
PromQL label selector, which must match the given variable name. If the variable is not specified in the derived metric usage, then the default selector is used.
"service=~\".*\""
Name of the variable.
"service"
Optional. Defines the selection criteria to select which query to use for the given derived metric. If selector is empty, then the corresponding query is the default query used for the derived metric. Exactly one default query must be configured.
Show child attributes
Labels that must match in the derived metric usage for the selector to match.
Show child attributes
name always matches against an exact label name.
type determines how the label value is matched.
EXACT value matches against a label value based on the configured type.
Timestamp of when the DerivedMetric was created. Cannot be set by clients.
Optional. Description of the derived metric.
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.
Timestamp of when the DerivedMetric was last updated. Cannot be set by clients.