Vigie
Definitions

Alerts

defineAlert watches error rates, latency, tasks, metrics, missing activity or any SQL, every 30 seconds.
definitions/alerts/acme.ts
import { defineAlert } from 'vigie/sdk'

export const checkoutP95 = defineAlert({
  id: 'checkout-p95',
  name: 'Checkout slow',
  family: 'Endpoint',
  when: { source: 'route-p95', method: 'POST', route: '/orders/:id/checkout', minRequests: 20 },
  above: 2000,
  window: '10m',
  unit: 'ms',
})

export const noPayments = defineAlert({
  id: 'no-payments',
  name: 'No payments ingested',
  family: 'No activity',
  when: { source: 'absence', taskKind: 'paynest.payment.ingest' },
  below: 1,
  window: '30m',
  quiet: { from: '00:00', to: '07:00', timezone: 'Europe/Paris' },
})

What to watch

when.sourceValue
request-error-rateShare of requests that answered 5xx, in %.
route-p95p95 duration of one route, or of every route. minRequests ignores quiet windows.
task-failure-rateShare of failed task attempts, in %, for one kind or all.
oldest-dueAge of the oldest task waiting for a worker, in seconds.
absenceAttempts of a task kind. Use with below: 1.
log-countEvents matching where fields.
metricA metric by name, with agg avg, max or latest, and attributes.
new-errorAn error never seen before.
sqlAny query returning t and v.

When it fires

FieldWhat it does
above, belowA fixed threshold.
sigmaFire when the value is that many standard deviations above its own last 7 days, instead of a fixed threshold.
windowThe time the value is computed over.
forHow long it has to hold before firing.
quietHours when it keeps recording but holds the notification until they end.
notifyOne channel by name. Without it, every channel. A name that no longer exists falls back to every channel: an alert never goes silent.

Alerts that fire within 30 seconds of each other go out as one message, with the errors behind them and what to do. See Alerts and notifications.

Copyright © 2026