Sinks
Sinks overview
Sinks are where events leave evlog — built-in drain adapters, custom drains, the drain pipeline (batch + retry + fanout), and identity headers.
A sink is anything that receives a wide event and does something terminal with it: ship to a provider, write to disk, send to a queue, post to a webhook. evlog ships built-in adapters for popular providers (Adapters overview) — this section is for everything beyond that.
You touch sinks when:
- You want to send events to a backend that has no built-in adapter
- You want to combine several drains with batching, retry, and fanout
- You want receivers to identify evlog traffic by
User-Agent/X-Evlog-Source
Pages here
| What | When | |
|---|---|---|
| Custom drains | defineDrain() and defineHttpDrain() — write your own | You ship to a backend without a built-in adapter |
| Drain pipeline | createDrainPipeline() — batch + retry + buffer + fanout | You hit any provider in production at non-trivial volume |
| Identity headers | User-Agent: evlog/<version> + X-Evlog-Source on every request | You want to recognize evlog traffic in your provider's UI |
| Fanout & multi-drain | Recipe combining the pipeline with several drains in parallel | You want events to reach Axiom AND Datadog AND Sentry AND fs |
Going further
Once you have a custom drain that's worth sharing across projects, package it as an npm library.
Integration as package
Package a custom framework integration as an npm library so your team — or the open-source community — can install evlog support for runtime X with one command.
Custom drains
defineDrain and defineHttpDrain — write your own drain to ship wide events to any backend without a built-in adapter.