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 environments are assigned or removed
Create a log alert
- Go to Settings.
- Under Project, select Alerts.
- Click + Alert.
- 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.
- Interval: How often to check for matching logs (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.
- 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 Test alert to verify the configuration. Braintrust runs the filter on recent logs. If matching logs exist, a test payload is sent. Check your webhook endpoint or Slack channel for the test message.
- Click Save.
Create an environment alert
Environment alerts notify you when prompt environments are updated. Use them to track deployments, monitor version changes, or trigger downstream workflows when prompts are promoted across environments.- Go to Settings.
- Under Project, select Alerts.
- Click + Alert.
- 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 Save.
Environment alerts trigger immediately when environments are updated. Unlike log alerts, they don’t have intervals or SQL filters. Testing is not available for environment alerts.
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' - Interval: Run hourly to catch quality regressions
- Action: Send to monitoring systems or trigger automated remediation
- SQL filter:
metrics.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
- Log alerts
- Environment alerts
When a log alert triggers a webhook, it sends this JSON structure:
Limitations
For hybrid 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
- Manage data with export and retention automations
- View logs to understand alert triggers
- Monitor deployments with dashboards
- SQL reference for advanced filter queries