Skip to main content
Alerting & Response/Alert Events
POSTAlertingSince 1.0SynchronousAuth Required

DryRunAlertRule

Simulate a rule evaluation against current data without creating alerts

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Request Inputs

Body Fields

  • expressionStringRequired

    PromQL expression to evaluate

    Example: avg(cpu_usage_percent) > 90

  • durationStringRequired

    Duration string for the for clause

    Example: 5m

  • labelsLinkedHashMapRequired

    Key-value labels attached to this resource

    Example: (nested object)

  • evalTimestampStringRequired

    Timestamp to use as evaluation point

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

  • simulateHoursIntegerRequired

    Number of hours to simulate forward

    Example: 24

Responses

200 OK

On success, this API returns the following response structure.

  • validBoolean

    Whether the expression is syntactically valid

    Example: true

  • parseErrorString

    Parse error message if expression is invalid

    Example: syntax error at line 5

  • errorPositionInteger

    Character position of the parse error

    Example: 20

  • firingBoolean

    Whether the rule would currently be firing

    Example: true

  • matchedSeriesInteger

    Number of time series matched by the expression

    Example: 3

  • sampleValuesList

    Sample values from matched time series

    Example: (nested array)

    • labelsLinkedHashMap

      Key-value labels attached to this resource

      Example: (nested object)

    • valueLong

      Metric value at the sample point

      Example: 95.3

    • timestampString

      Timestamp of the sample

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

  • simulationSummaryObject

    Simulation summary over the specified time range

    • totalEvalPointsInteger

      Total number of evaluation points in the simulation

      Example: 288

    • firingCountInteger

      Number of points where the rule would fire

      Example: 12

    • firingPercentageLong

      Percentage of time the rule would be firing

      Example: 4.2

    • firstFiringAtString

      First time the rule would fire during simulation

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

    • lastFiringAtString

      Last time the rule would fire during simulation

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

  • evalDurationString

    Duration of the evaluation

    Example: 120ms

Endpoint

POST/api/v1/alerting/dry-run

/api/v1/alerting/dry-run

Operation ID

DryRunAlertRule

Permalink

Request Example

curl -X POST '{host}/api/v1/alerting/dry-run' -H 'Authorization: Bearer {token}' -H 'Content-Type: application/json' -d '{"expression":"avg(cpu_usage_percent) > 90","duration":"5m","labels":"(nested object)","evalTimestamp":"2026-01-15T08:00:00Z","simulateHours":24,"tenantId":"tenant-001"}'

Response Example

200
{
  "valid": true,
  "parseError": "connection refused",
  "errorPosition": 20,
  "firing": true,
  "matchedSeries": 3,
  "sampleValues": [
    {}
  ],
  "simulationSummary": {},
  "evalDuration": "120ms"
}

Change History

This API has no change history records yet.

View all change history