Skip to main content
Notifications work without any setting. This page covers the settings you change when you want alerts for more than questions, a webhook, or a different retention. See How notifications work for the model.

Settings

A bad value or rule stops the server at start-up and names the setting.

Rules

A rule says which events raise a notification, for whom and through which channels:
category is one of input, run.failed, run.finished, run.held, delivery.failed or workflow. sessions and workflows are globs (empty means all). audience empty keeps the category’s default. channels names <type>:<name> entries of yukta.notifications.channels. A repeat of the same event inside cooldown raises the item’s count instead of a new item. A resolved item never reactivates.

A webhook channel

The body is JSON with a notification object. With a signing-secret the header X-Yukta-Signature: sha256=<hmac of the body> lets the receiver check the sender. The URL must pass yukta.egress.* and redirects are not followed. Delivery is at least once: a failed post is retried after 1 s, then with doubling delay up to 5 minutes, and given up after 10 tries. Make the receiver idempotent by notification id. A delivery that is given up raises a delivery.failed notification for administrators. Only the leader delivers, and queued deliveries live in the notification store (lost on a restart in Community). A question that reaches a route tier naming external:webhook:<name> also carries a one-time answer token; a rule’s channel never does.

Who raises what

  • Input requests always raise a question. With no rule for a category, run.failed alerts operators and delivery.failed alerts administrators; run.finished and run.held raise nothing until a rule names them. With rules for a category, only a matching rule raises (the first by name wins).
  • A workflow raises its own with NOTIFY_TERMINAL and target: inbox (at most 20 a minute and 200 per run), or a plugin through NotificationGateway. See example 10-inbox-notification.

People’s preferences

Each person sets, in the Inbox page, a level per category and muted sessions (GET/PUT /api/notifications/preferences). A category without a saved level keeps the server default. The desktop level also needs the browser permission, granted from the switch in the preferences sheet. For the desktop without a browser, run yukta-cli notify at login: Notifications from the terminal.

What to watch

The event stream (/api/notifications/stream) allows 8 streams per key and replays at most 500 missed changes after a reconnect; beyond that, or after a restart, it sends reset and the client reads the list again. If clients reset constantly, look for restarts or for a stream behind a proxy that closes idle connections.

Size the server for many stream clients

Every open stream receives every change it may see, so CPU grows with streams times changes. perf/run.sh notifications measures it with 1,000 open questions and stream clients that record how long each change took to reach them. Two scenarios:
  • Steady (the default): 5 answers a second for 2 minutes, 10 people reading their inbox every 5 s.
  • Burst: 500 answers in 10 s, 50 readers every second.
Steady results, with the jar in a container: The stream lag is the time from a change to its arrival at the client. Creating all 1,000 questions at once, before the test starts, takes 3 to 4 s to reach 100 to 200 streams (p95); that is not part of the figures above. The burst is heavier and does not pass on 2 vCPU with 100 streams: the container uses both CPUs and answer p95 is 4 s, stream lag p95 is 2.7 s, with no dropped events. If you expect bursts of hundreds of answers a second with many streams open, give the server more CPU, or have fewer clients follow the stream (a script that only needs the questions can poll yukta-cli notifications list). A dropped event shows in yukta.notifications.tap.dropped; the next list read or reconnect repairs the inbox.