Expand description
The loki-logger node — ships access logs to a Grafana Loki push API in
batches.
Ports the APISIX loki-logger plugin onto featherbit’s shared
BatchSink. Each request builds a log entry and
hands it to the sink with a non-blocking push; a background task groups a
batch into a single Loki stream (the configured labels) and POSTs the
{streams:[{stream, values:[[ns_ts, line], ...]}]} payload to
<endpoint>/loki/api/v1/push. The node never mutates the request/response
and never fails, so it belongs in the response pipeline, after the
upstream node.
Structs§
- Loki
Logger 🔒Flusher - Delivers batches by POSTing the Loki streams payload to a push endpoint.
- Loki
Logger Plugin - Batches access-log entries and POSTs them to a Grafana Loki push endpoint.
Functions§
- build_
loki_ 🔒payload - Builds the Loki push payload: one stream carrying
labels, with one[ns_timestamp, json_line]value per entry. Timestamps are the current wall-clock time in nanoseconds (as a decimal string, per the Loki API). Factored out of the network path for unit testing. - default_
labels 🔒 - parse_
labels 🔒 - Reads
log_labels(orlabels) as a string map, defaulting to{job: featherbit}.