Skip to main content

Module webhook

Module webhook 

Source
Expand description

Generic, template-driven webhook output sink (roadmap item #54).

One configurable HTTP sink, not a handful of bespoke service integrations: Slack, Teams, Discord, and PagerDuty ship as field-parametric YAML recipes in the docs, while the engine stays service-agnostic. Each webhook renders a templated URL, headers, and body per detection / correlation result and posts it over the shared egress-filtered HTTP client.

The webhook is a leaf on the shared async delivery layer (crate::io::delivery): the dispatcher owns the bounded queue, the retry/backoff schedule, terminal-failure-to-DLQ routing, and drain on shutdown. WebhookSink owns only the webhook-specific request behavior (template render, retryable-vs-permanent classification, per-entry token bucket). Webhooks run in the lossy on_full=drop mode so a third-party chat or paging endpoint never blocks the at-least-once token release for durable sinks (NATS, file); anything undeliverable lands in the DLQ.

Structs§

BuiltWebhook
A webhook sink plus the per-sink delivery config the dispatcher drives it with. The full-queue policy is fixed to Drop by the caller (the lossy seam that keeps a third-party HTTP endpoint off the at-least-once path).
RateLimitConfig
rate_limit: block. requests per per, burst = requests.
RetryConfig
retry: block. Each field overrides a delivery-layer default.
ScopeConfig
scope: block. Mirrors the enrichment scope axes.
WebhookConfig
One webhook’s YAML config block.
WebhookSink
One configured webhook. Filters each result by kind and scope, then renders and posts a templated request, classifying the outcome for the delivery layer.
WebhooksFile
Top-level webhooks config file.

Enums§

WebhookConfigError
Errors produced while loading or validating a webhooks config.
WebhookKind
Parsed kind: discriminator.

Constants§

DEFAULT_WEBHOOK_ATTEMPTS
Default total attempts (one initial try plus retries).
DEFAULT_WEBHOOK_BACKOFF
Default exponential backoff base.
DEFAULT_WEBHOOK_MAX_BACKOFF
Default backoff ceiling.
DEFAULT_WEBHOOK_QUEUE_SIZE
Default bounded queue depth between the dispatcher and the worker.
DEFAULT_WEBHOOK_TIMEOUT
Default per-request timeout when timeout: is omitted.

Functions§

build_webhooks
Validate and build every webhook in file into a BuiltWebhook.
load_webhooks_file
Read and deserialize a webhooks config file (no validation; see build_webhooks).