Wisp is in pre-release, self-hosted since GitHub suspended us. Install it, or see the changelog.

Wisp

Logs, Metrics and Traces

All off until set. No app code needed.

Env varWhat it does
WISP_LOG=jsona JSON line per request on stdout (default off). A separate thread writes it. severity is INFO, WARNING (4xx) or ERROR (5xx). Past 4096 queued lines it drops lines and logs a dropped count
METRICS_KEYserves /_wisp/metrics (Prometheus text) to Authorization: Bearer <METRICS_KEY>
OTEL_EXPORTER_OTLP_ENDPOINTOTLP/HTTP JSON traces to <endpoint>/v1/traces
OTEL_EXPORTER_OTLP_TRACES_ENDPOINTtraces URL, used as is
OTEL_SERVICE_NAMEservice name on spans
OTEL_EXPORTER_OTLP_HEADERSapi-key=…,x=…
OTEL_BSP_SCHEDULE_DELAYbatch delay in ms (5000, at least 1)

Logs

{"time":"2026-10-03T12:00:00.123Z","severity":"INFO","method":"GET","route":"/blog/[slug]","path":"/blog/hello","status":200,"ms":0.021,"bytes":1480,"id":"7f3a9c2e","ip":"203.0.113.7"}
  • ip is cx.client_ip() (see WISP_CLIENT_IP_HEADER); id is x-request-id, generated if absent, echoed in the reply.

Metrics

A wrong or missing key gets 401; METRICS_KEY unset gets 404. Scrape with metrics_path: /_wisp/metrics and authorization: { credentials: <key> }.

MetricNotes
wisp_requests_total{route, status}status class like 2xx
wisp_request_duration_seconds{route}histogram, 1 ms to 10 s
wisp_requests_in_flightgauge
wisp_uptime_secondsgauge
process_resident_memory_bytesLinux only

Traces

  • One server span per request (GET /blog/[slug]).
  • An incoming traceparent is continued, and its sampled flag decides (W3C parent-based sampling). The reply carries its own (trace in WISP_LOG=json). On a public edge, drop the header at the proxy.
  • An endpoint path holding a space, CR or LF stops the server at start. Plain HTTP only: use a Collector for TLS.
let _s = wisp::span("charge card"); // child span until dropped, current across .await
let t = wisp::traceparent(); // Some("00-…-01"): header for a downstream call

Is This Page Useful?

View This Page's Source

Type to search every docs page and heading.