Skip to main content
Alerting & Response/Alert Events

DryRunAlertRule

Simulate a rule evaluation against current data without creating alerts

POST/api/v1/alerting/dry-run

Operation ID

DryRunAlertRule

Since

1.0

Execution Mode

Synchronous

Auth Context

Auth Required

Auth Context

Send these values as request headers when calling this API.

AuthorizationstringRequired

Bearer Token

X-Tenant-IDstring

X-Tenant-ID

Request Inputs

application/json

Body Fields

  • expression
    StringRequired

    PromQL expression to evaluate

    Example: avg(cpu_usage_percent) > 90

  • duration
    StringRequired

    Duration string for the for clause

    Example: 5m

  • labels
    LinkedHashMapRequired

    Key-value labels attached to this resource

    Example: (nested object)

  • evalTimestamp
    StringRequired

    Timestamp to use as evaluation point

    Example: 2026-01-15T08:00:00Z

  • simulateHours
    IntegerRequired

    Number of hours to simulate forward

    Example: 24

Responses

200 OK
200 OK

On success, this API returns the following response structure.

  • valid
    Boolean

    Whether the expression is syntactically valid

    Example: true

  • parseError
    String

    Parse error message if expression is invalid

    Example: syntax error at line 5

  • errorPosition
    Integer

    Character position of the parse error

    Example: 20

  • firing
    Boolean

    Whether the rule would currently be firing

    Example: true

  • matchedSeries
    Integer

    Number of time series matched by the expression

    Example: 3

  • sampleValues
    List

    Sample values from matched time series

    Example: (nested array)

    • labels
      LinkedHashMap

      Key-value labels attached to this resource

      Example: (nested object)

    • value
      Long

      Metric value at the sample point

      Example: 95.3

    • timestamp
      String

      Timestamp of the sample

      Example: 2026-01-15T08:00:00Z

  • simulationSummary
    Object

    Simulation summary over the specified time range

    • totalEvalPoints
      Integer

      Total number of evaluation points in the simulation

      Example: 288

    • firingCount
      Integer

      Number of points where the rule would fire

      Example: 12

    • firingPercentage
      Long

      Percentage of time the rule would be firing

      Example: 4.2

    • firstFiringAt
      String

      First time the rule would fire during simulation

      Example: 2026-01-15T08:00:00Z

    • lastFiringAt
      String

      Last time the rule would fire during simulation

      Example: 2026-01-15T08:00:00Z

  • evalDuration
    String

    Duration of the evaluation

    Example: 120ms

Change History

This API has no change history records yet.

View all change history