notify DSL.
Defining notifications
Add notifications when creating your monitor:griffin apply.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get alerted when monitors fail
notify DSL.
import { createMonitorBuilder, notify, Frequency, GET, Json } from "@griffin-app/griffin";
const monitor = createMonitorBuilder({
name: "health-check",
frequency: Frequency.every(1).minute(),
notifications: [
notify.onFailure().toSlack("#alerts"),
notify.onRecovery().toEmail(["oncall@example.com"]),
],
})
.request("check", { ... })
.build();
export default monitor;
griffin apply.
notify.onFailure().toSlack("#alerts")
notify.onRecovery().toSlack("#alerts")
notify.onConsecutiveFailures(3).toSlack("#alerts")
notify.onSuccessRateBelow(95, 60).toEmail(["team@example.com"])
// 95% threshold over the last 60 minutes
notify.onLatencyAbove({
threshold_ms: 2000,
percentile: "p95",
window_minutes: 30,
}).toSlack("#performance")
notify.onFailure().toSlack("#channel-name")
notify.onFailure().toEmail(["alice@example.com", "bob@example.com"])
notify.onFailure().toWebhook("my-webhook-integration")
notify.onFailure()
.withCooldown(15) // 15 minutes
.toSlack("#alerts")
# List notification rules
griffin notifications list
# Filter by monitor
griffin notifications list --monitor health-check
# Send a test notification
griffin notifications test --integration slack --channel "#test"