Skip to main content

rivet/config/
notifications.rs

1//! Operator notifications — Slack webhooks, on-event triggers.
2
3use schemars::JsonSchema;
4use serde::Deserialize;
5
6#[derive(Debug, Deserialize, JsonSchema, Clone)]
7#[serde(deny_unknown_fields)]
8pub struct NotificationsConfig {
9    pub slack: Option<SlackConfig>,
10}
11
12#[derive(Debug, Deserialize, JsonSchema, Clone)]
13#[serde(deny_unknown_fields)]
14pub struct SlackConfig {
15    pub webhook_url: Option<String>,
16    pub webhook_url_env: Option<String>,
17    #[serde(default)]
18    pub on: Vec<NotifyEvent>,
19}
20
21#[derive(Debug, Deserialize, JsonSchema, Clone, PartialEq, Eq)]
22#[serde(rename_all = "snake_case")]
23pub enum NotifyEvent {
24    Failure,
25    SchemaChange,
26    Degraded,
27}