Skip to main content
Alerting is an enterprise-only feature and requires the enterprise Bifrost image.
The alerting block lets you seed alert channels and CEL-based alert rules directly in config.json. Rules evaluate governance metrics, such as budget usage and rate limit usage, and send notifications to Slack, Microsoft Teams, PagerDuty, or generic webhooks. Use this page when you want alerting to be managed as code. For the UI workflow and runtime concepts, see Alerting, Alert Rules, Alert Channels, and Alert History.
Alert rules reference governance scopes and budgets by ID. Define the referenced virtual keys, teams, customers, budgets, and rate limits under governance, or create them through the Web UI or API before the rule is evaluated.

Quick example

This example creates one Slack channel, one generic webhook channel, and two rules: one budget alert for a virtual key and one request-rate-limit alert for a team.

Top-level fields

Alerting samples the current governance counters at this interval. Keep evaluation_interval_seconds comfortably below the shortest configured budget or rate-limit reset duration so a brief threshold breach is observed before governance resets the counter.

Webhook network controls

Keep both webhook network controls disabled for production unless you are intentionally sending alerts to trusted internal endpoints. Enabling them weakens TLS and SSRF protections.

Channels

Each channel needs a stable id, a display name, a type, an enabled flag, and a type-specific config.

Channel config

Credential and endpoint fields support env.VAR_NAME references. Bifrost resolves the value from the process environment at startup.
For each alias pair, provide exactly one key. For example, use either webhook_url or url for Slack, not both.

Rules

Rules evaluate CEL expressions against governance metrics collected for a virtual key, team, or customer.

Scopes and targets

Every rule must have a scope. A rule can either evaluate all budgets for that scope or target one budget explicitly. target_type and target_id must be provided together.

CEL examples

For the complete variable list, see Alerting CEL variables.

Specific budget example

Use target_type: "budget" and target_id when a rule should evaluate one budget instead of every budget in the scope.

Reset-cycle notifications

Set notify_once_per_reset_cycle when you want one notification per budget or rate-limit reset window, instead of repeated sends based on a cooldown.
This is useful for rate limits and recurring budgets because the same condition can remain true until the reset window rolls over.

Clusters

In a Bifrost Enterprise cluster, only the leader evaluates alert rules and writes alert history. Followers can serve inference traffic and update shared governance usage, but they do not dispatch duplicate alerts. No extra alerting configuration is required for cluster mode. Configure clustering separately under cluster_config.

Validation

Add the schema URL to get editor autocomplete and validation:
The schema validates the channel type, required channel config, rule scopes, required channel_ids, and the target_type / target_id pairing.

Next steps

Alerting overview

Learn how alert evaluation, cooldowns, history, and clustering work.

Governance config

Define the virtual keys, teams, customers, budgets, and rate limits that alert rules evaluate.