CLI (tail & serve)
Use the tracekit command-line tool to tail JSONL logs or run the local web viewer.
Installing tracekit-sdk registers the tracekit CLI command from tracekit.cli:main.
tracekit tail
Follows an existing JSONL file and pretty-prints new events to stdout as they are appended.
terminal
tracekit tail events.jsonlExpected output:
output
[tracekit tail] Watching events.jsonl … (Ctrl+C to stop)[2026-11-28 09:56:01] INFO Service started[2026-11-28 09:56:02] SPAN process_order (15.03ms) ok[2026-11-28 09:56:03] ERROR KeyError: 'qty'If the file does not exist yet, tracekit tail prints [tracekit] File not found: ... and exits with code 1.
tracekit serve
Starts a local ThreadingHTTPServer bound to 127.0.0.1 (default port 8765) with:
POST /ingest— accepts a single event JSON object or a batch JSON arrayGET /events— returns the in-memory ring buffer (last 500 events) as JSONGET /— renders a dark-mode HTML dashboard that auto-refreshes every 2 seconds
terminal
tracekit serve --port 8765Expected output:
output
[tracekit serve] Listening on http://127.0.0.1:8765[tracekit serve] Ingest: http://127.0.0.1:8765/ingest (POST JSON)[tracekit serve] Press Ctrl-C to stop.Common mistakes
- Running
python -m tracekit: Usetracekit tail ...ortracekit serve ...directly. - Tailing a file that hasn't been created yet: Run your app once or
touch events.jsonlbefore startingtracekit tail events.jsonl.