Wisp

Type to search every docs page and heading.

Logs, Metrics and Traces

All off until set. They work in the binary, Docker and Lambda, with no app code.

Env varWhat it does
WISP_LOG=jsona JSON line per request on stdout (off default)
METRICS_KEYserves /_wisp/metrics (Prometheus text) to Authorization: Bearer <METRICS_KEY>
OTEL_EXPORTER_OTLP_ENDPOINTsends OTLP/HTTP JSON traces to <endpoint>/v1/traces (e.g. http://localhost:4318)
OTEL_EXPORTER_OTLP_TRACES_ENDPOINTthe traces URL, used as is
OTEL_SERVICE_NAMEservice name on spans
OTEL_EXPORTER_OTLP_HEADERSapi-key=…,x=…
OTEL_BSP_SCHEDULE_DELAYbatch delay in ms (5000)

Logs

{"time","method","route":"/blog/[slug]","path":"/blog/hello","status","ms","bytes","id","ip"}
  • route is the route folder (null if none); path omits the query.
  • ip is cx.client_ip() (see WISP_CLIENT_IP_HEADER).
  • id is the client's x-request-id, or made, and is echoed.

Metrics

Wrong or missing key: 401. METRICS_KEY unset: 404. Prometheus scrape config: metrics_path: /_wisp/metrics, authorization: { credentials: <key> }.

MetricNotes
wisp_requests_total{route, status}status class like 2xx; route="" if none matched
wisp_request_duration_seconds{route}histogram, 1 ms to 10 s
wisp_requests_in_flightgauge
wisp_uptime_secondsgauge
process_resident_memory_bytesLinux only

Traces

  • A server span per request (GET /blog/[slug]).
  • An incoming traceparent is continued, and the reply carries its own (trace in WISP_LOG=json).
  • A down collector costs requests nothing.
  • Plain HTTP only: use a Collector for TLS.
let _s = wisp::span("charge card"); // child span until dropped
let t = wisp::traceparent(); // Some("00-…-01"): header for a downstream call

Is This Page Useful?

Edit This Page