Manage Alerting

Import a check rule

This endpoint allows you to import an existing check rule into your organization. It's intended for one-time migrations rather than ongoing check rule management. Unlike the standard API, this endpoint supports importing check rules with full editability, allowing you to modify check rules that were previously created elsewhere. Note: This endpoint is not recommended for Infrastructure-as-Code (IaC) workflows. Using it in IaC scenarios can cause configuration drift and inconsistencies between your source configuration and the imported check rule state. Importing a check rule without an id will create a new check rule and return the created asset with a generated id. Importing a check rule with an existing id (metadata>dash0Extensions>id) will override the corresponding check rule definition. In case there is no check rule with the given id a new check rule will be created.

post/api/import/check-rule

Request

  • Base URL: https://api.eu-west-1.aws.dash0.com
  • URL: https://api.eu-west-1.aws.dash0.com/api/import/check-rule
  • Auth: none declared

Query parameters

datasetstring

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

The associated dataset.

Request body

datasetstring

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

idstring

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

namestring required

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

expressionstring 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.

intervalstring
forstring
keep_firing_forstring
labelsobject

Label are key-value pairs that can be used to add additional metadata to a check. They map to Prometheus alerting rules' "labels" field.

enabledboolean

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.

summarystring

Deprecated: use the "summary" annotation instead.

descriptionstring

Deprecated: use the "description" annotation instead.

keepFiringForstring

Deprecated: use "keep_firing_for" instead.

Response

The imported check rule.

datasetstring

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

idstring

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

namestring required

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

expressionstring 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.

intervalstring
forstring
keep_firing_forstring
labelsobject

Label are key-value pairs that can be used to add additional metadata to a check. They map to Prometheus alerting rules' "labels" field.

enabledboolean

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.

summarystring

Deprecated: use the "summary" annotation instead.

descriptionstring

Deprecated: use the "description" annotation instead.

keepFiringForstring

Deprecated: use "keep_firing_for" instead.

Changes

No recorded changes to this operation across all 1 revision of this API.