Skip to main content
POST
Check a log alert against the last 7 days

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

application_id
string<uuid>
required

Body

application/json

A log alert that is not saved, to check against the last 7 days: the environment_id and the condition of a create. No other key is accepted (a create's name, send_to and severity are refused by name).

environment_id
string<uuid>
required

One of the application's environments.

condition
ApplicationAlertCondition · object
required

The one condition an application alert has. app_metric fires when the metric reads above threshold for hold_minutes in a row; the metrics are the ones the application's charts draw for the environment. app_log fires when more than threshold lines matching search are written in five minutes, counted over every place the environment runs in, added up; metric is log_lines and hold_minutes 0, and both may be left out on a create or change.

Response

The check, or why it could not be given (could_not_check)

How many times a log alert would have told someone in the last 7 days: 2,016 five-minute stretches ending on the latest 300-second boundary, each place the environment runs in counted on Ankra's hosted logs and the places added up stretch by stretch. A stretch is over when its lines are more than threshold, and a run of stretches over is one time. The real check counts a sliding five minutes about once a minute, so a burst split across two stretches can stay under in both and still fire for real. The check is whole or it is not given: when could_not_check is set, counted_from, first_line_day, kept_days, installations.read, would_have_told, firings, firings_truncated and series are null, never 0.

checked_from
string<date-time>
required

The start of the 7 days, in whole seconds, UTC.

checked_to
string<date-time>
required

The end of the 7 days: the latest 300-second boundary at or before the check, UTC.

stretch_seconds
integer
required

The length of one stretch: 300.

stretches
integer
required

How many stretches the 7 days hold: 2016.

counted_from
string<date-time> | null
required

Where every place's lines are counted from: checked_from, or later when log history was turned on for a cluster of the environment inside the 7 days (its stretches before then hold none of that cluster's lines).

first_line_day
string<date> | null
required

The first UTC day, from the day checked_from falls on, on which any place holds any line at all, searched or not; null when no place holds a line in the 7 days, or when could_not_check is set.

kept_days
integer | null
required

How many days the store keeps a line; null when the store does not say.

installations
ApplicationLogAlertPreviewInstallations · object
required

How many places the environment runs in, and how many were read.

would_have_told
integer | null
required

How many times it would have told.

firings
ApplicationLogAlertPreviewFiring · object[] | null
required

Those times, newest first, at most 20.

Maximum array length: 20
firings_truncated
boolean | null
required

Whether there were more than 20 times.

series
ApplicationLogAlertPreviewHour · object[] | null
required

For each hour of the 7 days, oldest first, the most lines one of its stretches held.

Required array length: 168 elements
could_not_check
ApplicationLogAlertPreviewFailure · object | null
required

Why the check could not be given; null when it was.