Skip to content

v0.3.78

Choose a tag to compare

@github-actions github-actions released this 11 May 23:41
· 1961 commits to main since this release
feat(runtime/logger): Tinybird request-log shipper (v0.3.78)

Adds an optional per-request HTTP log shipper that ships NDJSON rows
to a Tinybird datasource. Disabled by default — only activates when
PYLON_TINYBIRD_TOKEN and PYLON_PROJECT_ID are both set in env, so
standalone Pylon deploys pay zero cost.

Designed for Pylon Cloud's per-project Logs page: provisionMachine
will set these envs on each customer Fly machine, the shipper batches
events in the background and POSTs to {host}/v0/events?name=request_log
every 2s or 100 events (whichever first). Bounded mpsc::sync_channel
(capacity 2048) drops on backpressure rather than blocking the
request hot path — request latency unaffected even if Tinybird hangs.

Schema 1:1 with apps/control-plane/tinybird/datasources/request_log
in pylon-cloud:
- timestamp / project_id / deployment_id / path / method / status
- cpu_ms / bytes_in / bytes_out / region / error

Hook in metrics::record_request — after the existing access log line.
Process-global OnceLock<Option<Arc<TinybirdLogger>>> so the hot path
is a single is_none() check when disabled.

Tests: civil-from-days round trips + ISO format width + env disable.