Expand description
The lago node — meters API traffic into Lago, an
open-source usage-based billing platform.
Ported from APISIX’s lago.lua. Unlike the other loggers this node is a
metering integration, not an access log: it emits one billing event
per request so Lago can price API consumption against a customer
subscription. Each request produces a Lago usage event; events are buffered
by a BatchSink and POSTed as a batch to <endpoint>/api/v1/events/batch
with a Bearer <token> header. The node passes the context through
unchanged.
§Deviations from APISIX
- APISIX takes
endpoint_addrs(an array, one picked at random per flush). featherbit takes a singleendpoint. - APISIX builds
propertiesfrom a configuredevent_propertiesmap of$vartemplates. featherbit reuses the shared log-entry builder, sopropertiesis the standard request/response log entry (or alog_formatcustom entry). This keeps the metering payload consistent with the other loggers; configurelog_formatto shape it.
Structs§
- Lago
Flusher 🔒 - Delivers batched usage events to
<endpoint>/api/v1/events/batch. - Lago
Plugin - Emits one Lago billing event per request, delivered in batches.
Functions§
- build_
batch_ 🔒body - Wraps a batch of events into the Lago batch-events request body.
- build_
event 🔒 - Builds one Lago usage event.
- now_
secs 🔒 - required_
str 🔒