Prometheus Alert Rule
Definition
Check rules represent a periodically evaluated expression to determine the health of a resource. The result of the evaluation are zero or more CheckEvaluations.
Optional dataset to query across. Defaults to whatever is configured to be the default dataset for the organization.
Server-populated metadata for the alert rule. Read-only on responses; ignored on write.
User defined id for getting/updating/deleting the alert rule through the API.
Human-readable and templatable name for the check. In Prometheus alerting rules this is called "alert".
An editable PromQL expression that can leverage the complete Dash0 Query Language. It furthermore supports a variable called $__threshold.
-
$__thresholdcan be used as a placeholder for both the degraded and failed thresholds. The thresholds are defined in the thresholds field. When$__thresholdis used in the expression, thethresholdsfield is required and at least one of the thresholds must be defined.Usage of
$__thresholdimplies that the PromQL expression may have to be evaluated up to two times using the degraded threshold and critical threshold respectively. -
Top-level AND statements are treated as enablement conditions that specify when the check should "be running", i.e., is active. The use-cases for enablement conditions are several, e.g., requiring a minimum amount of requests being served before triggering due to errors rates, maintenance windows or muted timeframes.
Thresholds to use for the $__threshold variable in the expression field.
By default degraded and failed are absolute values. The optional baseline and
changeGate sub-objects are detector configuration: the presence of one of them is the
discriminator that changes how degraded and failed are interpreted.
- Neither present:
degradedandfailedare absolute values compared against the expression's own value, as they always have been. baselinepresent:degradedandfailedare re-interpreted as z-score cutoffs — multiples of the watched entity's own typical spread away from its prediction — rather than as absolute values. Each configured cutoff must be greater than0and less than1000000, the detector score cap.changeGatepresent:degradedandfailedstay absolute, but the check additionally requires the value to have become materially worse than it recently was before it fails.
At most one of baseline and changeGate may be set. A request setting both is rejected
with a 400; the mutual exclusion is enforced by the server rather than by this schema,
matching the existing treatment of metric versus servicesMetricQuery.
Specifies a check evaluation frequency.
For, also called "pending duration", specifies a time duration for how long the expression must have been continuously satisfied before a check evaluation is created. When the check evaluation is created, its "start" timestamp is set to the instant the pending duration started elapsing.
This is effectively equivalent to the "for" configuration in Prometheus alerting rules.
Default value is 0s, meaning that the check would transition immediately into one of the degraded or critical states at the first failed evaluation.
If for is not set to 0s (or equivalent, like 0m), its value must be larger than or equal to that of evaluationFrequency, as it does not make sense to expect the status of a check to change without another evaluation having occurred.
Keep firing for, also called "resolution duration", that specifies a time duration for how long the evaluation of the expression must be consistently healthy before an critical or degraded check enters the healthy state, or de-escalates from critical to degraded.
This is effectively equivalent to the "keep_firing_for" configuration in Prometheus alerting rules.
Default value is 0s, meaning that the check would transition immediately into the healthy state at the first successful evaluation.
If keep_firing_for is not set to 0s (or equivalent, like 0m), its value must be larger than or equal to that of evaluationFrequency, as it does not make sense to expect the status of a check to change without another evaluation having occurred.
Label are key-value pairs that can be used to add additional metadata to a check. They map to Prometheus alerting rules' "labels" field.
Annotations are key-value pairs that can be used to add additional metadata to a check. They map to Prometheus alerting rules' "annotations" field.
The "summary" and "description" annotations are expected and are used as the human-readable summary and description of the check rule.
A boolean flag to enable or disable the check rule. When a check rule is disabled, it will not be evaluated, and no check evaluations will be created. This field is optional and defaults to true.
Deprecated: use the "summary" annotation instead.
Deprecated: use the "description" annotation instead.
Deprecated: use "keep_firing_for" instead.
Used by 5
These schemas and endpoints reference this type directly.