Enable the Slack integration before creating an alert to send to a Slack channel.
Alert types
Braintrust supports two types of alerts:- Log alerts: Trigger when conditions are met on production logs
- Environment alerts: Trigger when prompt or dataset environments are assigned or removed
Create a log alert
- Go to Settings > Alerts.
- Click Alert, or Create alert if you don’t have any alerts yet.
- Enter alert name.
- Select Log event as the event type.
- Configure alert conditions:
- SQL filter: Query that defines which logs trigger the alert. See Write SQL filters for examples. When Loop is enabled, select Generate to create the filter from a natural-language description.
- Notify interval: The minimum time between notifications for this alert (5 min, 30 min, 1 hr, 4 hr, 12 hr, 24 hr).
- Select an action type:
- Webhook: Enter the webhook URL to send a JSON payload to. Click Test next to the Webhook URL field to verify the configuration. See Test an alert.
- Slack: Select a Slack channel using the searchable dropdown. The channel list refreshes automatically every 7 days. To trigger a manual refresh, click Refresh channels. If your channel doesn’t appear, you can enter its manually.
- Click Create.
Create an environment alert
Environment alerts notify you when prompt or dataset environments are updated. Use them to track deployments, monitor version changes, or trigger downstream workflows when prompts or datasets are promoted across environments.- Go to Settings > Alerts.
- Click Alert, or Create alert if you don’t have any alerts yet.
- Enter alert name.
- Select Environment update as the event type.
- Optionally filter by specific environments (e.g., only alert on “production” changes).
- Select an action type:
- Webhook: Enter the webhook URL to send a JSON payload to.
- Slack: Select a Slack channel using the searchable dropdown. The channel list refreshes automatically every 7 days. To trigger a manual refresh, click Refresh channels. If your channel doesn’t appear, you can enter its manually.
- Click Create.
Environment alerts trigger immediately when environments are updated. Unlike log alerts, they don’t have intervals or SQL filters.
Test an alert
Testing is available for log alerts that use the Webhook action. Click Test next to the Webhook URL field. Braintrust runs the SQL filter on recent logs. If matching logs exist, a test payload is sent. Check your webhook endpoint for the test message. Testing is not available for Slack actions or for environment alerts.Edit or delete an alert
- Go to Settings > Alerts.
- Select the alert you want to change.
- Update the alert configuration, then click Update.
Common alert patterns
- Log alerts
- Environment alerts
Error monitoring: Catch production issues immediately.
- SQL filter:
error IS NOT NULL AND metadata.environment = 'production' - Action: Post to Slack #incidents channel or create tickets in issue trackers
- SQL filter:
scores.factuality < 0.8 AND metadata.environment = 'production' - Notify interval: 1 hr
- Action: Send to monitoring systems or trigger automated remediation
- SQL filter:
estimated_cost() > 1.0 - Action: Webhook to cost tracking systems or budget management tools
- SQL filter:
metadata.model = 'gpt-4o' AND (error IS NOT NULL OR scores.accuracy < 0.8) - Action: Post to team channel for model performance investigation
- SQL filter:
metadata.user_tier = 'enterprise' AND metadata.feature = 'summarization' - Action: Post to team channel for priority investigation
- SQL filter:
(scores.accuracy < 0.7 OR error IS NOT NULL) AND metadata.priority = 'high' - Action: Immediate Slack notification to on-call team
- Action: Use external systems to track historical rates and webhook alerts to capture spikes
Webhook payloads
Webhooks can route alerts to any third-party incident, on-call, or automation tool that accepts inbound webhooks (for example, PagerDuty’s Events API, Opsgenie, or workflow platforms like Zapier). Braintrust delivers a fixed JSON payload (shown below) with theContent-Type: application/json header, and doesn’t support custom headers or payload formats. If the destination requires a specific payload shape or authentication headers, add a lightweight forwarder that transforms the Braintrust webhook payload before delivering it.
Webhook URLs must use
http or https. To protect against server-side request forgery (SSRF), Braintrust blocks webhook delivery to private, internal, or otherwise reserved network addresses. Use Test to confirm your endpoint is reachable.- Log alerts
- Environment alerts
When a log alert triggers a webhook, it sends this JSON structure:
Limitations
For self-hosted deployments:- Alerts are available starting with v0.0.72.
- The Slack integration is available starting with v1.1.29.
- The channel list shows the most recently active channels. If your target channel doesn’t appear, use the manual entry option.
Next steps
- Export to cloud storage and configure data retention
- View logs to understand alert triggers
- Monitor deployments with dashboards
- SQL reference for advanced filter queries