Skip to content

latent.observability.webhook

Classes

WebhookSink

WebhookSink(url: str, headers: dict[str, str] | None = None, timeout: float = 5.0, max_text_chars: int = 500, max_workers: int = _DEFAULT_MAX_WORKERS)

Fire-and-forget HTTP POST to a configurable URL.

Uses a bounded thread pool (max_workers) to prevent thread exhaustion under load. Events dropped when the pool is saturated are logged at DEBUG.

Methods

WebhookSink.close

close(wait: bool = True) -> None

Shut down the thread pool, optionally waiting for in-flight deliveries.

WebhookSink.emit

emit(event: GuardrailEvent) -> None