67 docs indexed

Alerting

Runtime-configurable operational alerting over Slack and email (SMTP), managed from the dashboard Settings page with no restart.

obleth delivers operational alerts — model-health transitions, upstream failures, budget/expiry warnings, and other gateway issues — to Slack and email (SMTP). Alerting is configured at runtime from the dashboard Settings page (or the Management API) and applies immediately, without a restart.

How it works

A single in-process alert dispatcher is shared by both the data plane (proxy) and the Management API. Because they run in the same process, saving settings swaps the active configuration atomically and takes effect instantly — there is no pub/sub propagation delay and no restart.

  • Persistence: settings are stored in Postgres (app_settings, key alerts) so they survive restarts. On boot, obleth loads the saved settings; if none exist it falls back to the legacy OBLETH_SLACK_WEBHOOK_URL environment variable (see Bootstrap).
  • Non-blocking: alert delivery never blocks the request hot path. Each alert is deduplicated by key within a cooldown window and dispatched on a background task.
  • Secrets: the Slack webhook URL and SMTP password are write-only. The API and dashboard report only whether each is set; their values are never returned.

Everything below lives on the Settings → Alerts tab — paste a Slack webhook, toggle email, and set the delivery cooldown, then save:

Control-plane Settings page with the Alerts tab selected, showing a Slack incoming-webhook URL field, an Enable email alerts toggle, and a Delivery section with an alert cooldown set to 300 seconds.

Channels

Slack

Deliver alerts to a Slack channel via an incoming webhook. Paste the webhook URL into Settings → Slack and save. To remove it later, tick Remove the configured Slack webhook and save.

The gateway POSTs to this URL itself, so the webhook is held to the same destination policy as any registered upstream: a URL that resolves to a blocked address (link-local / cloud metadata) is rejected with 400 when you save it. See Security — SSRF.

Email (SMTP)

Deliver alerts over SMTP to one or more recipients. Configure under Settings → Email:

FieldNotes
SMTP hoste.g. smtp.example.com
SMTP port587 for STARTTLS (default), 25 for plaintext relays
Username / PasswordOptional SMTP auth (omit for unauthenticated relays)
From addressEnvelope/sender address
RecipientsOne or more addresses (comma or newline separated)
STARTTLSEnabled by default; disable only for trusted plaintext relays

Leave the password blank to keep the stored value when editing other fields; tick Remove the stored password to clear it.

With STARTTLS on, the gateway opens a STARTTLS relay to the configured host. With it off, the connection is plain SMTP — the message body and, if you configure them, the SMTP username and password travel unencrypted. Only turn it off for a relay reachable over a trusted network path.

What raises an alert

Alerts are issued by both the data plane and the Management API. The deduplication key is shown in each message as Issue, so you can map a notification back to its source:

Issue keyRaised when
model_health_down:* / model_health_recovery:*A model crosses its health-failure threshold, or recovers
upstream_request_failed / upstream_stream_errorAn upstream call fails after all retries and endpoints, or a stream breaks mid-response
scheduler_unavailableThe fairshare scheduler could not be reached
term_budget_warn:* / term_budget_exhausted:*A tenant reaches 80% of, or exhausts, its cumulative term budget
key_term_budget_warn:* / key_term_budget_exhausted:*The same, for a key's own budget
tenant_expiry:*A tenant's access window is about to end
guardrails_*A guardrails policy matched
redis_*A Redis lookup, budget reserve, reconcile, or cache operation failed — the message states whether the request was admitted (fail-open) or rejected
mcp_upstream_request_failed / mcp_tool_discovery_failedAn MCP server call or tool listing failed
energy_power_poll_failedThe energy Prometheus query is unreachable
slurm_reconcile_held / slurm_reconcile_recoveredThe Slurm provisioner has gone 10 minutes without a successful reconcile tick, or recovered

Cooldown

Repeat alerts for the same issue are suppressed within a cooldown window (default 300s), set under Settings → Delivery → Alert cooldown. This prevents a flapping upstream from flooding a channel.

Test alert

Use the Send test alert button on the Settings page to deliver a test message through every currently-configured channel. The result is reported per channel so you can confirm Slack and SMTP credentials before relying on them in production.

Management API

Alerting is also configurable over the Management API:

MethodPathDescription
GET/api/v1/settings/alertsCurrent alert settings (secrets masked)
PUT/api/v1/settings/alertsUpdate alert settings (applies live)
POST/api/v1/settings/alerts/testSend a test alert on all channels
# Configure Slack + email in one call
curl -X PUT http://localhost:9180/api/v1/settings/alerts \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "slack_webhook_url": "https://hooks.slack.com/services/T000/B000/XXXX",
    "min_interval_secs": 300,
    "email": {
      "smtp_host": "smtp.example.com",
      "smtp_port": 587,
      "username": "apikey",
      "smtp_password": "•••",
      "from_address": "alerts@example.com",
      "recipients": ["oncall@example.com", "sre@example.com"],
      "starttls": true
    }
  }'

# Send a test alert
curl -X POST http://localhost:9180/api/v1/settings/alerts/test \
  -H "Authorization: Bearer $TOKEN"

The GET response reports slack_webhook_set and email.password_set booleans instead of the secret values. On PUT, omit slack_webhook_url / smtp_password to keep the existing secret, or set clear_slack_webhook / clear_smtp_password to true to remove it.

Bootstrap from environment

For existing deployments, the legacy environment variables still seed alerting on first boot when no settings have been saved:

VariablePurpose
OBLETH_SLACK_WEBHOOK_URLInitial Slack webhook (used only until settings are saved)
OBLETH_SLACK_ALERT_MIN_INTERVAL_SECSInitial cooldown (default 300)

Once you save settings from the dashboard or API, the persisted configuration is authoritative and these variables are ignored.