Comment on page
⏰
Alerts
Alerts can be created for a query or formula to notify (via Notification Channel) when a certain condition is met.
Assume we want to alert if TVL of your project is below a threshold, you could
- Select the metric that represents the TVL
- Add a alert condition

You can count certain number of logs matching a criteria, and setup alerts based on the condition.

Beyond static content, you can also reference variables inside your alert message. In log based alert, you can use
.Samples
to reference the list of the event log instances. e.g. For event log recored an amount
field, you can customize the message like this:Transfer events found:
{{ range .Samples }}
value {{.amount}}, at chain: {{.chain}}
{{ end }}
The syntax is straightforward here:
{{.VARIABLE_NAME}}
is to reference a variable or field (same as you defined in your event log) by name.{{range .VARIABLE_NAME}} ... {{ end }}
is to loop through a list of elemments if the variable is a list.
Last modified 3mo ago