Create a new check rule.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
string
^[a-zA-Z0-9_-]{3,26}$

The associated dataset.

Body Params

Check rules represent a periodically evaluated expression to determine the health of a resource.
The result of the evaluation are zero or more CheckEvaluations.

string
^[a-zA-Z0-9_-]{3,26}$

Optional dataset to query across. Defaults to whatever is configured to be the default dataset for the organization.

metadata
object

Server-populated metadata for the alert rule. Read-only on responses; ignored on write.

string

User defined id for getting/updating/deleting the alert rule through the API.

string
required

Human-readable and templatable name for the check. In Prometheus alerting rules this is called "alert".

string
required

An editable PromQL expression that can leverage the complete Dash0 Query Language. It furthermore
supports a variable called $__threshold.

  • $__threshold can be used as a placeholder for both the degraded and failed thresholds. The
    thresholds are defined in the thresholds field. When $__threshold is used in the expression,
    the thresholds field is required and at least one of the thresholds must be defined.

    Usage of $__threshold implies 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
object

Thresholds to use for the $__threshold variable in the expression field.

string
(\d+(ms|s|m|h|d|w|M|Q|y))+
Defaults to 1m

Specifies a check evaluation frequency.

string
(\d+(ms|s|m|h|d|w|M|Q|y))+
Defaults to 0s

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.

string
(\d+(ms|s|m|h|d|w|M|Q|y))+
Defaults to 0s

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.

labels
object

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
object

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.

boolean

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.

string
length ≤ 255
deprecated

Deprecated: use the "summary" annotation instead.

string
length ≤ 2048
deprecated

Deprecated: use the "description" annotation instead.

string
deprecated

Deprecated: use "keep_firing_for" instead.

Responses

Language
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json