Alerts

Backtest an anomaly detector over a time range without saving a rule.

Changed on

Replays the metric against the same band the evaluator would use, returning the per-bucket band + which points would have fired. Powers the form's "would this have fired?" preview and the explorer band overlay. Read-only.

post/otel/alerts/preview

Request

  • Base URL: /api (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /api/otel/alerts/preview
  • Auth: HTTP bearer

Request body

aggregationstring required

One of avg|sum|min|max|count|rate|p50|p90|p95|p99.

end_timestring nullable

RFC 3339; defaults to now.

metric_namestring required
project_idinteger required
start_timestring nullable

RFC 3339; defaults to 7 days before end_time.

window_secsinteger required

Example request

{
  "end_time": "2025-10-12T12:15:47Z",
  "start_time": "2025-10-12T12:15:47Z"
}

Response

Per-bucket band + breach points

baseline_samplesinteger required

Baseline sample count (drives the sufficient flag).

breach_countinteger required

How many points in the range would have fired.

sufficientboolean required

Whether the baseline had enough history for a trustworthy band.

Example response

{
  "points": [
    {
      "bucket": "2025-10-12T12:15:47Z"
    }
  ]
}

Changes

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status