Alert notifications
Use the public AIObservabilityWorker callback to deliver alerts to your
application's notification system.
import assert from 'node:assert/strict';
import {
AIObservabilityWorker,
type AlertNotification,
} from '@tagna/udiot/telemetry';
const received: AlertNotification[] = [];
const worker = new AIObservabilityWorker({
onAlert: notification => { received.push(notification); },
});
assert.equal(typeof worker.evaluate, 'function');
worker.stop();
Register rules using the alerts API, provide metrics and choose
a worker evaluation interval. Call start() to enable periodic evaluation and
stop() during shutdown. Your callback may return a promise.
The built-in ConsoleAlertNotifier, SlackAlertNotifier,
WebhookAlertNotifier, createAlertNotifiers and standalone
AlertNotifier type exist internally but are not named exports of the telemetry
entry point. Do not import them through undocumented deep paths.
For custom delivery, keep webhook credentials in secret configuration, redact notification payloads, bound outbound request time, validate destinations, and handle delivery failure/retries in your application. The worker is not a durable notification queue and does not guarantee exactly-once delivery. See observability.