Historical preview of a rule shape
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.
bearerAuthAuthorizationBearer <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.
org_id*Org Iduuidapplication/json- body
The rule shape to evaluate historically. No id; rule may not yet exist.
scope_type*ScopeType"site""tag"site_id?|nulltag?string|nullmetric*Metricaggregation*Aggregationidentity?|nulloperator*Operator"gt""gte""lt""lte"condition_type*ConditionType"absolute""relative_change"threshold*Thresholdwindow_seconds*Window Secondsbaseline_window_seconds?integer|nullfilters?|nullwindow_days?|nullre_notify_after_seconds?integer|nullSuccessful Response
application/json- response
buckets*array<>breach_count*Breach Countfire_count*Fire Countunit?MetricUnitWhat 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.
"ms""s""score""count""bytes""rate""percent"granularity*Granularitywindow_days*Window Dayscurl -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}'{ "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}