Skip to content

Rule Patterns and Examples

Observability provides patterns to help with the construction of meaningful rules based on a standard trigger-condition-action format. The following tables give some examples of the conditions and actions you can set up for each type of rule trigger.

Tip

For technical details about each type of rule, see Observability Rule Triggers.

Examples by trigger

Task status

Task status rules can be set for * batch pipeline tasks with a failed, completed, running, or completed with warnings status.

Rule trigger and condition Rule action
When task status
is Completed
For any component in journey *
Send email to email address 1, email address 2
When task status
is Failed
For <a specific batch pipeline>
Send web request to URL
Then, specify the payload, and optionally, the headers.

Runs

Run rules can be set for * batch pipeline run statuses, timeliness, and unexpected changes.

Rule trigger and condition Rule action
When run
has a running status
For <a specific batch pipeline>
Send email to email address 1, email address 2
When run
has a completed with warnings status
For any component in journey *
Send web request to URL
Then, specify the payload, and optionally, the headers.
When run
has a missing status
For <a specific batch pipeline>
Send email to email address 1, email address 2
When run
has a late start time, late end time
For any component in journey *
Send web request to URL
Then, specify the payload, and optionally, the headers.

Advanced run rule options

You can configure advanced conditions for all cases except running status.

Rule trigger and condition Rule action Summary of the outcome
When run
has a failed status
For <a specific batch pipeline>

Advanced Options
after 10 occurrences of this status in a row
and grouped by run name
Trigger action for each subsequent occurrence of this status
Send web request to URL
Then, specify the payload, and optionally, the headers.
The system sends a web request to the URL when Observability receives 10 runs in a row for the specified pipeline, where all runs have a Failed status and the same name.

The system only sends one notification when the condition is met (and not, for example, if these conditions are met an eleventh or twelfth time).

Note that the system can receive other events or other runs with different run names during this time.
When run
has a completed status
For any component in journey *

Advanced Options
after 2 occurrences of this status in a row
and grouped by run name
Trigger action for each subsequent occurrence of this status
Send email to email address 1, email address 2 When Observability receives 2 runs in a row with status Completed, for each batch pipeline in this journey, the system sends an email to the two recipients with details.

The system sends one email when the condition is met, and with each following Completed status received.

Test status

Test status rules can be set for tests with a failed, warning, or passed status.

Rule trigger and condition Rule action
When test status
is Passed
For any component in journey
Send email to email address 1, email address 2
When test status
is Failed
For <a specific batch pipeline>
Send web request to URL
Then, specify the payload, and optionally, the headers.
When test status
is Warning
For <a specific dataset>
Send web request to URL
Then, specify the payload, and optionally, the headers.

Message log

Message log rules can be set for severity log levels of error, warning, and/or info. You can include regex patterns to check against the log message.

Rule trigger and condition Rule action
When log matches
level = Error
and message contains (?:|\)limit(?:|\)
For any component in journey
Send email to email address 1, email address 2
When log matches
level = any
and message contains ^This exact message only$
For <a specific batch pipeline>
Send web request to URL
Then, specify the payload, and optionally, the headers.
When log matches
level = Error, Info
and message contains input_data[\d]+.csv
For <a specific dataset>
Send email to email address 1, email address 2
When log matches
level = any
and message contains ________
For <a specific server>
Send web request to URL
Then, specify the payload, and optionally, the headers.

Metric log

Metric log rules can be set for data values equal to, less than, less than or equal, greater than, or greater than or equal to a specific numeric value.

Rule trigger and condition Rule action
When metric matches
key = key_example_1
and value equals 1
For any component in journey
Send email to email address 1, email address 2
When metric matches
key = key_example_2
and value less than or equal 100
For <a specific streaming pipeline>
Send web request to URL
Then, specify the payload, and optionally, the headers.
When metric matches
key = ______
and value greater than or equals 10
For any component in journey
Send email to email address 1, email address 2
When metric matches
key = ______
and value ________
For <a specific dataset>
Send web request to URL
Then, specify the payload, and optionally, the headers.

Instance alert

Instance alert rules can be set for instances that have error-level and/or warning-level alerts.

Rule trigger and condition Rule action
When instance has alert
of type Incomplete
Send web request to URL
Then, specify the payload, and optionally, the headers.
When instance has alert
of type Out of sequence, Dataset not ready
Send email to email address 1, email address 2