The Query field is where you define the conditions that will trigger the alert.
For example, you can set up an alert to notify you when the number of errors in your logs exceeds a certain threshold.
On our example, we're going to set up an alert that will trigger when an exception occurs in the api service
and the route is /members/{user_id}.
In this case, we're using the http.route attribute to filter the records by route.
The Time window field allows you to specify the time range over which the query will be executed.
The Webhook URL field is where you can specify a URL to which the alert will send a POST request when triggered.
For now, Logfire alerts only send the requests in Slack format.
Get a Slack webhook URL
To get a Slack webhook URL, follow the instructions in the Slack documentation.
After filling in the form, click the Create alert button. And... Alert created!
You can configure an alert by clicking on the Configuration button on the right side of the alert.
You can update the alert, or delete it by clicking the Delete button. If instead of deleting the alert, you want to disable it, you can click on the Active switch.