Alerts
Alerts let you trigger a webhook when conditions are met on new logs in Braintrust. This is useful for triggering alerts in tools like Slack or PagerDuty, or for kicking off custom workflows.
If you are on a hybrid deployment, alerts are available starting with v0.0.72
.
Creating an alert
To create an alert, navigate to Configuration > Alerts in your project.
Alert configuration
- Alert name: A descriptive name for your alert
- Description (optional): Additional context about the alert's purpose
- Event type: Currently supports Log event
- BTQL filter: Filter logs using BTQL syntax (if empty, matches all logs)
- Interval: How frequently the alert should check for matching events
- Webhook URL: The endpoint that will receive the alert context as a payload
You can also integrate Braintrust alerts with over 7,000 apps using the Braintrust Zapier integration.
Webhook payload
When a webhook alert is triggered, it sends a JSON
payload to your webhook URL with the following structure:
Testing alerts
Before saving or updating an alert, you can test it to confirm behavior with the Test alert button. Braintrust will trigger the alert as if the intiating event occurred, running it through the BTQL filter on recent data. If matching logs are found, a test payload will be sent to your webhook URL.
If no matching logs are found, you may need to adjust your BTQL filter or the alert interval.