Syntax
Basic Syntax
At Keep, we view alerts as workflows, which consist of a series of steps executed in sequence, each with its own specific input and output. To keep our approach simple, Keepβs syntax is designed to closely resemble the syntax used in GitHub Actions. We believe that GitHub Actions has a well-established syntax, and there is no need to reinvent the wheel.
Full Example
title=examples/raw_sql_query_datetime.yml
Breakdown π¨
Workflow
Workflow
is built of:
- Metadata (id, description. owners and tags will be added soon)
steps
- list of stepsactions
- list of actionson-failure
- an action with no condition used in case of an alert failure
Provider
Provider
is built of:
type
- the type of the provider (see supported providers)config
- the provider configuration. you can either supply it explicitly or using"{{ providers.mysql-prod }}"
with
- all type-specific provider configuration. for example, formysql
we will provide the SQL query.on-failure
- handling the error when provider execution fails, it is built of:retry
- specifies the retry parameters which include:count
: maximum number of retries.interval
: duration in seconds between each retry.
Condition
Condition
is built of:
name
- a unique identifier to the conditiontype
- the type of the conditionvalue
- the value that will be supplied to the condition during the alert executioncompare_to
- whatsvalue
will be compared againstcompare_type
- all type-specific condition configuration
Steps/Actions
Step/Action
is built of:
name
- the name of the action.condition
- a list of conditions thatprovider
- the provider that will trigger the action.throttle
- you can throttle the action.if
- action can be limited to when certain conditions are met.foreach
- whenforeach
block supplied, Keep will evaluate it as a list, and evaluates theaction
for every item in the list.
The provider
configuration is already covered in Providers
On-failure
On-failure is actually an Action
with no condition used to notify in case the alert failed with an exception.
The provider is passed a message
(string) to itβs notify
function.