Skip to content
NAVIDIFF DOCUMENTATION

Tracing

Every judge / explain / guide / ask / chat / claim-vs-diff run is traced to Langfuse, self-hosted:

bash
cd ops/langfuse && cp .env.example .env   # then change every CHANGEME
docker compose up -d
# after ~2–3 minutes: http://localhost:3000

LANGFUSE_INIT_* in that .env headlessly creates an org, project, user and API keypair on first boot — no UI click-through. Put that keypair in the app's own env (LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY), restart the server, and the next run has a trace.

server/observability.ts is the whole integration: it wraps the Claude Agent SDK's query() with OpenInference's ClaudeAgentSDKInstrumentation, which types each run as an AGENT span carrying the model, token counts and cost straight off the SDK's result message, plus a TOOL span per tool call. server/claude.ts wraps each feature in a named parent span, grouped by sessionId — the same session the app already means by one PR review — with repo/pr/model/effort as metadata. A run that fails marks its span ERROR; a run that comes back empty marks WARNING rather than reading as success.

vardefault
LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY(unset)trace every model run; without them, tracing is off, not broken.
LANGFUSE_BASE_URLhttp://localhost:3000where traces go.
LANGFUSE_TRACING_ENVIRONMENT / LANGFUSE_RELEASE(unset)keep a local dev server and an always-on unit from mixing in one dashboard.

GET /preflight reports whether tracing is currently on.

Ready to review a real change?

Open Navidiff