Skip to content

Commit 08cf555

Browse files
[synthetics] Update monitor status rule docs (#4345)
* document synthetics monitor status rule * document how to move from the uptime rule to the synthetics rule * add code comments * address feedback from @paulb-elastic * add info on using slos for availability * add link * delete table * port to serverless
1 parent 0984f82 commit 08cf555

15 files changed

+381
-7
lines changed
78.8 KB
Loading
60.3 KB
Loading
64 KB
Loading
226 KB
Loading
144 KB
Loading
52.9 KB
Loading

docs/en/observability/monitor-status-alert.asciidoc

Lines changed: 257 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,158 @@
11
[[monitor-status-alert]]
22
= Create a monitor status rule
3+
34
++++
45
<titleabbrev>Monitor status</titleabbrev>
56
++++
67

8+
There are two types of monitor status rules:
9+
10+
* <<monitor-status-alert-synthetics>> for use with <<monitor-uptime-synthetics,Elastic Synthetics>>.
11+
* deprecated:[8.15.0] <<monitor-status-alert-uptime>> for use with the Uptime app.
12+
+
13+
[WARNING]
14+
====
15+
*The Uptime app and the Uptime monitor status rule are deprecated as of version 8.15.0.*
16+
17+
If you are using the Uptime monitor status rule with the Uptime app, you should migrate the Uptime monitor and the Uptime monitor status rule to Elastic Synthetics and the Synthetics monitor rule.
18+
19+
If you are using the Uptime monitor status rule with a monitor created with Elastic Synthetics, you should migrate the Uptime monitor status rule to the Synthetics monitor rule.
20+
Learn how in <<migrate-monitor-rule>>.
21+
====
22+
23+
[discrete]
24+
[[monitor-status-alert-synthetics]]
25+
== Synthetics monitor status
26+
27+
Within the Synthetics UI, create a **Monitor Status** rule to receive notifications
28+
based on errors and outages.
29+
30+
. To access this page, go to **{observability}** → **Synthetics**.
31+
. At the top of the page, click **Alerts and rules** → **Create rule**.
32+
. Select **Monitor status rule**.
33+
34+
[discrete]
35+
[[synthetic-monitor-filters]]
36+
=== Filters
37+
38+
The *Filter by* section controls the scope of the rule.
39+
The rule will only check monitors that match the filters defined in this section.
40+
In this example, the rule will only alert on `browser` monitors located in `Asia/Pacific - Japan`.
41+
42+
[role="screenshot"]
43+
image::images/synthetic-monitor-filters.png[Filter by section of the Synthetics monitor status rule,width=600]
44+
45+
[discrete]
46+
[[synthetic-monitor-conditions]]
47+
=== Conditions
48+
49+
Conditions for each rule will be applied to all monitors that match the filters in the <<synthetic-monitor-filters,*Filter by* section>>.
50+
You can choose the number of times the monitor has to be down relative to either a number of checks run
51+
or a time range in which checks were run, and the minimum number of locations the monitor must be down in.
52+
53+
[NOTE]
54+
====
55+
Retests are included in the number of checks.
56+
====
57+
58+
The *Rule schedule* defines how often to evaluate the condition. Note that checks are queued, and they run as close
59+
to the defined value as capacity allows. For example, if a check is scheduled to run every 2 minutes, but the check
60+
takes longer than 2 minutes to run, a check will not run until the previous check has finished.
61+
62+
You can also set *Advanced options* such as the number of consecutive runs that must meet the rule conditions before
63+
an alert occurs.
64+
65+
In this example, the conditions will be met any time a `browser` monitor is down `3` of the last `5` times
66+
the monitor ran across any locations that match the filter. These conditions will be evaluated every minute,
67+
and you will only receive an alert when the conditions are met three times consecutively.
68+
69+
[role="screenshot"]
70+
image::images/synthetic-monitor-conditions.png[Filters and conditions defining a Synthetics monitor status rule,width=600]
71+
72+
[discrete]
73+
[[synthetic-monitor-action-types]]
74+
=== Action types
75+
76+
Extend your rules by connecting them to actions that use the following supported built-in integrations.
77+
78+
include::../shared/alerting-connectors.asciidoc[width=600]
79+
80+
After you select a connector, you must set the action frequency.
81+
You can choose to create a summary of alerts on each check interval or on a custom interval.
82+
For example, send email notifications that summarize the new, ongoing, and recovered alerts each hour:
83+
84+
[role="screenshot"]
85+
image::images/synthetic-monitor-action-types-summary.png[width=600]
86+
87+
Alternatively, you can set the action frequency such that you choose how often the action runs
88+
(for example, at each check interval, only when the alert status changes, or at a custom action interval).
89+
In this case, you must also select the specific threshold condition that affects when actions run:
90+
the _Synthetics monitor status_ changes or when it is _Recovered_ (went from down to up).
91+
92+
[role="screenshot"]
93+
image::images/synthetic-monitor-action-types-each-alert.png[width=600]
94+
95+
You can also further refine the conditions under which actions run by specifying that actions only run
96+
when they match a KQL query or when an alert occurs within a specific time frame:
97+
98+
* *If alert matches query*: Enter a KQL query that defines field-value pairs or query conditions that must
99+
be met for notifications to send. The query only searches alert documents in the indices specified for the rule.
100+
* *If alert is generated during timeframe*: Set timeframe details. Notifications are only sent if alerts are
101+
generated within the timeframe you define.
102+
103+
[role="screenshot"]
104+
image::images/synthetic-monitor-action-types-more-options.png[width=600]
105+
106+
[discrete]
107+
[[synthetic-monitor-action-variables]]
108+
==== Action variables
109+
110+
Use the default notification message or customize it.
111+
You can add more context to the message by clicking the icon above the message text box
112+
and selecting from a list of available variables.
113+
114+
[role="screenshot"]
115+
image::images/synthetic-monitor-action-variables.png[width=600]
116+
117+
The following variables are specific to this rule type.
118+
You an also specify {kibana-ref}/rule-action-variables.html[variables common to all rules].
119+
120+
`context.checkedAt`:: Timestamp of the monitor run.
121+
`context.hostName`:: Hostname of the location from which the check is performed.
122+
`context.lastErrorMessage`:: Monitor last error message.
123+
`context.locationId`:: Location id from which the check is performed.
124+
`context.locationName`:: Location name from which the check is performed.
125+
`context.locationNames`:: Location names from which the checks are performed.
126+
`context.message`:: A generated message summarizing the status of monitors currently down.
127+
`context.monitorId`:: ID of the monitor.
128+
`context.monitorName`:: Name of the monitor.
129+
`context.monitorTags`:: Tags associated with the monitor.
130+
`context.monitorType`:: Type (for example, HTTP/TCP) of the monitor.
131+
`context.monitorUrl`:: URL of the monitor.
132+
`context.reason`:: A concise description of the reason for the alert.
133+
`context.recoveryReason`:: A concise description of the reason for the recovery.
134+
`context.status`:: Monitor status (for example, "down").
135+
`context.viewInAppUrl`:: Open alert details and context in Synthetics app.
136+
137+
[discrete]
138+
[[monitor-status-alert-uptime]]
139+
== Uptime monitor status
140+
141+
[WARNING]
142+
====
143+
*The Uptime app and the Uptime monitor status rule are deprecated as of version 8.15.0.*
144+
145+
If you are using the Uptime monitor status rule with the Uptime app, you should migrate the Uptime monitor and the Uptime monitor status rule to Elastic Synthetics and the Synthetics monitor rule.
146+
147+
If you are using the Uptime monitor status rule with a monitor created with Elastic Synthetics, you should migrate the Uptime monitor status rule to the Synthetics monitor rule.
148+
Learn how in <<migrate-monitor-rule>>.
149+
====
150+
7151
Within the {uptime-app}, create a **Monitor Status** rule to receive notifications
8152
based on errors and outages.
9153

10-
. To access this page, go to **{observability}** -> **Uptime**.
11-
. At the top of the page, click **Alerts and rules** -> **Create rule**.
154+
. To access this page, go to **{observability}** **Uptime**.
155+
. At the top of the page, click **Alerts and rules** **Create rule**.
12156
. Select **Monitor status rule**.
13157

14158
[TIP]
@@ -18,7 +162,7 @@ If you already have a query in the overview page search bar, it's populated here
18162

19163
[discrete]
20164
[[status-alert-conditions]]
21-
== Conditions
165+
=== Conditions
22166

23167
You can specify the following thresholds for your rule.
24168

@@ -45,7 +189,7 @@ the alert is triggered.
45189

46190
[discrete]
47191
[[action-types-status]]
48-
== Action types
192+
=== Action types
49193

50194
You can extend your rules by connecting them to actions that use the following
51195
supported built-in integrations. Actions are {kib} services or integrations with
@@ -69,7 +213,7 @@ image::images/uptime-run-when-selection.png[Action frequency for each alert,widt
69213

70214
[discrete]
71215
[[action-variables-status]]
72-
== Action variables
216+
=== Action variables
73217

74218
Use the default notification message or customize it.
75219
You can add more context to the message by clicking the icon above the message text box
@@ -80,9 +224,115 @@ image::images/monitor-status-alert-default-message.png[Default notification mess
80224

81225
[discrete]
82226
[[recovery-variables-status]]
83-
== Alert recovery
227+
=== Alert recovery
84228

85229
To receive a notification when the alert recovers, select *Run when Recovered*. Use the default notification message or customize it. You can add more context to the message by clicking the icon above the message text box and selecting from a list of available variables.
86230

87231
[role="screenshot"]
88-
image::images/monitor-status-alert-recovery.png[Default recovery message for monitor status rules with open "Add variable" popup listing available action variables,width=600]
232+
image::images/monitor-status-alert-recovery.png[Default recovery message for monitor status rules with open "Add variable" popup listing available action variables,width=600]
233+
234+
[discrete]
235+
[[migrate-monitor-rule]]
236+
== Migrate from the Uptime rule to the Synthetics rule
237+
238+
If you are currently using the Uptime monitor status with a monitor created with Elastic Synthetics,
239+
you should migrate the Uptime monitor status rule to:
240+
241+
* The *Synthetics monitor rule* for <<migrate-monitor-rule-synthetics-rule,synthetic monitor _status_ checks>>.
242+
* The *Synthetics availability SLI* for <<migrate-monitor-rule-synthetics-sli,synthetic monitor _availability_ checks>>.
243+
244+
[discrete]
245+
[[migrate-monitor-rule-synthetics-rule]]
246+
=== Uptime status check to Synthetics monitor rule
247+
248+
[discrete]
249+
==== Filters
250+
251+
The KQL syntax that you used in the Uptime monitor status rule is also valid in the *Filter by* section
252+
of the Synthetics monitor status rule. The Synthetics monitor status rule also offers dropdowns for several
253+
categories for easy filtering. However, you can still use KQL syntax for these categories if you prefer.
254+
255+
[discrete]
256+
==== Conditions
257+
258+
[NOTE]
259+
====
260+
If you are using the _Uptime availability condition_ refer to <<migrate-monitor-rule-synthetics-sli>>.
261+
====
262+
263+
If you're using the Uptime status check condition, you can recreate similar effects using the following
264+
Synthetics monitor status rule condition equivalents:
265+
266+
|===
267+
| | Uptime | Synthetics equivalent
268+
269+
| *Number of times the monitor is down*
270+
a| `ANY MONITOR IS DOWN >=` `{number}` times
271+
272+
*Example*: `ANY MONITOR IS DOWN >=` `5` times
273+
a| `IS DOWN` `{number}` times
274+
275+
*Example*: `IS DOWN` `5` times
276+
277+
| *Timeframe*
278+
a| `WITHIN last` `{number}` `{time range unit}`
279+
280+
*Example*: `WITHIN last` `15` `minutes`
281+
282+
a| `WITHIN THE LAST` `{number}` `{time range unit}`
283+
284+
*Example*: `WITHIN THE LAST` `15` `minutes`
285+
286+
|===
287+
288+
[discrete]
289+
==== Actions
290+
291+
The default messages for the Uptime monitor status rule and Synthetics monitor status rule are different,
292+
but you can recreate similar messages using <<synthetic-monitor-action-variables,Synthetics monitor status rule action variables>>.
293+
294+
[discrete]
295+
[[migrate-monitor-rule-synthetics-sli]]
296+
=== Uptime availability check to Synthetics availability SLI
297+
298+
SLOs allow you to set clear, measurable targets for your service performance, based on factors like availability.
299+
The <<synthetics-availability-sli,Synthetics availability SLI>> is a service-level indicator (SLI) based on the
300+
availability of your synthetic monitors.
301+
302+
[discrete]
303+
==== Filters
304+
305+
The KQL syntax that you used in the Uptime monitor status rule is also valid in the *Query filter*
306+
field of the Synthetics availability SLI.
307+
308+
[discrete]
309+
==== Conditions
310+
311+
Use the following Synthetics availability SLI fields to replace the Uptime monitor status rule's
312+
availability conditions:
313+
314+
|===
315+
| | Uptime | Synthetics equivalent
316+
317+
| *Number of checks that are down relative to all checks run*
318+
a| `ANY MONITOR IS UP IN <` `{percent}` of checks
319+
320+
*Example*: `ANY MONITOR IS UP IN <` `90%` of checks
321+
a| *Target / SLO (%)* field
322+
323+
*Example*: `90%`
324+
325+
| *Timeframe*
326+
a| `WITHIN THE LAST` `{number}` `{time range unit}`
327+
328+
*Example*: `WITHIN THE LAST` `30` `days`
329+
a| *Time window* and *Duration* fields
330+
331+
*Example*: Time window: `Rolling`, Duration: `30 days`
332+
|===
333+
334+
[discrete]
335+
==== Actions
336+
337+
After creating a new SLO using the Synthetics availability SLI, you can use the SLO burn rate rule.
338+
For more information about configuring the rule, see <<slo-burn-rate-alert,Create an SLO burn rate rule>>.

0 commit comments

Comments
 (0)