fastmon Docs
Notifications

Historical preview of a rule shape

Fehler melden

Replay a rule shape (which may or may not be saved yet) against the last N days of data and return time-series buckets with threshold breaches + the exact number of notifications the state machine would have emitted.

Powers the chart in the rule editor: as the user tweaks metric, aggregation, threshold, window, filters or the re-notify cadence, the client re-calls this endpoint and re-renders the chart. Bucket size is always equal to the rule's evaluation window so each bucket's value represents one real evaluation.

Authentifizierung

bearerAuth
headerAuthentifizierungBearer <fm_… / fmo_…>

API token generated from the fastmon dashboard (Account → API Token) or at organization level (fmo_…, one that outlives its creator). Send as Authorization: Bearer fm_... or paste the full token (including its prefix) into the Authorize dialog.

Pfad-Parameter

org_id*Org Id
Formatuuid

Request-Body

application/json
  1. body

The rule shape to evaluate historically. No id; rule may not yet exist.

scope_type*ScopeType
Value in"site""tag"
site_id?|null
tag?string|null
metric*Metric
aggregation*Aggregation
identity?|null
operator*Operator
Value in"gt""gte""lt""lte"
condition_type*ConditionType
Value in"absolute""relative_change"
threshold*Threshold
window_seconds*Window Seconds
baseline_window_seconds?integer|null
filters?|null
window_days?|null
re_notify_after_seconds?integer|null

Response-Body

Successful Response

application/json
  1. response
buckets*array<>
breach_count*Breach Count
fire_count*Fire Count
unit?MetricUnit

What a metric's numbers are measured in.

"s" (migration 072) is the cache-age pair and the only non-millisecond duration in the catalog. It is a widening of the vocabulary, so a form that switches on this needs the case: reporting those two as "ms" instead would put a threshold off by a factor of 1000.

Value in"ms""s""score""count""bytes""rate""percent"
granularity*Granularity
window_days*Window Days
POST
/organizations/{org_id}/notifications/preview
Example Request
curl -X POST 'https://api.fastmon.eu/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/notifications/preview' \  -H 'Content-Type: application/json' \  -d '{  "scope_type": "site",  "metric": "string",  "aggregation": "string",  "operator": "gt",  "condition_type": "absolute",  "threshold": 0,  "window_seconds": 0}'
Example Response
{  "buckets": [    {      "timestamp": "2019-08-24T14:15:22Z",      "value": 0,      "is_breach": true,      "is_fire": false    }  ],  "breach_count": 0,  "fire_count": 0,  "unit": "ms",  "granularity": "string",  "window_days": 0}