A Lightweight Local Trace Store

Learn the contract without a heavy platform

Langfuse is an open-source platform for tracing, evaluation, prompt management, and LLM analytics. A production self-hosted deployment includes multiple backing services. That architecture is valuable at team scale but is too heavy for a short sandbox on a shared CPU host.

The lab uses JSONL, or JSON Lines: one JSON object per line. Appending is simple, jq can query it, and Python can aggregate it. The important lesson is the trace schema and instrumentation boundary, not a particular dashboard.

Write one complete event after a request finishes. Use a durable centralized store in a real distributed deployment, define retention, restrict access, and emit an error status even when inference fails. Validate required fields so incomplete telemetry fails visibly.

Note: The local tracer is inspired by Langfuse concepts; it is not Langfuse and does not reproduce its UI, distributed ingestion, sessions, prompt management, or production storage guarantees.
Goal: Query the repaired JSONL traces from the terminal to calculate request count, token use, cost, and average latency.