Dash0 acquires Polar Signals

Manage Alerting

Create a new check rule

post/api/alerting/check-rules

Parameters 1

datasetquery

The associated dataset.

References Dataset

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

stringpattern "^[a-zA-Z0-9_-]{3,26}$"
bash
Sample request
1234567
curl --request POST 'https://api.eu-west-1.aws.dash0.com/api/alerting/check-rules' \
--header "Authorization: Bearer ${DASH0_AUTH_TOKEN}" \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Example",
"expression": "up == 0"
}'

Request body required

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

Dataset

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.

string

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

stringrequired

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

stringrequired

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.

CheckThresholds

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: degraded and failed are absolute values compared against the expression's own value, as they always have been.
  • baseline present: degraded and failed are 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 than 0 and less than 1000000, the detector score cap.
  • changeGate present: degraded and failed stay 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.

Duration

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.

Duration

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.

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.

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.

stringdeprecated

Deprecated: use the "summary" annotation instead.

stringdeprecated

Deprecated: use the "description" annotation instead.

stringdeprecated

Deprecated: use "keep_firing_for" instead.

Responses

Create a new check rule.

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

Dataset

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.

string

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

stringrequired

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

stringrequired

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.

CheckThresholds

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: degraded and failed are absolute values compared against the expression's own value, as they always have been.
  • baseline present: degraded and failed are 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 than 0 and less than 1000000, the detector score cap.
  • changeGate present: degraded and failed stay 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.

Duration

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.

Duration

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.

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.

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.

stringdeprecated

Deprecated: use the "summary" annotation instead.

stringdeprecated

Deprecated: use the "description" annotation instead.

stringdeprecated

Deprecated: use "keep_firing_for" instead.