Skip to Content
v0.8.0 · shippedNative mobile SDKs, optional Sentry enrichment, and bring-your-own keys/storage. Read the changelog →
Self-hostingLangfuse + Sentry

Observability

Mushi ships with first-class Langfuse (LLM traces) and Sentry (error tracking) integration. Both are configured as Edge Function secrets.

Langfuse (LLM tracing)

Every LLM invocation is wrapped in a Langfuse trace with the prompt version, model, token usage, latency, cost, and key_source (tenant vs platform).

cd packages/server npx supabase secrets set LANGFUSE_PUBLIC_KEY=pk-lf-… npx supabase secrets set LANGFUSE_SECRET_KEY=sk-lf-… npx supabase secrets set LANGFUSE_HOST=https://cloud.langfuse.com

Replace LANGFUSE_HOST with your self-hosted Langfuse URL if needed.

BYOK traces include key_source: "tenant" so you can filter Langfuse by tenant vs platform usage. See BYOK for details.

What gets traced

TraceFunctionPrompt version key
Report classificationclassify-reportmushi-classifier-v*
Fix generationfix-workermushi-fixer-v*
Fix judgmentjudge-batchmushi-judge-v*
Intelligence reportintelligence-reportmushi-intel-v*
PDCA iterationpdca-runnertracked per model config

Viewing traces

In Langfuse: Traces → filter by project_id (the Langfuse trace tag matches the Mushi project ID). The Health page in the Mushi admin console shows recent LLM call logs pulled from Langfuse.

Sentry (error tracking)

Every Edge Function wraps its handler with withSentry() from _shared/sentry.ts. Unhandled exceptions are forwarded to Sentry automatically.

cd packages/server npx supabase secrets set SENTRY_DSN=https://…@sentry.io/… npx supabase secrets set SENTRY_ENVIRONMENT=production npx supabase secrets set SENTRY_RELEASE=$GIT_SHA

Admin SPA Sentry

The Vite SPA also ships a Sentry integration. Pass the DSN at build time:

VITE_SENTRY_DSN=https://…@sentry.io/… npm run -w apps/admin build

OpenTelemetry

The fix orchestrator emits OTel spans for every sandbox lifecycle event, agent tool call, and PR creation. Point your collector at the standard endpoint:

npx supabase secrets set OTEL_EXPORTER_OTLP_ENDPOINT=https://your-collector/v1/traces

Spans include report_id, attempt_id, and stage tags so you can join OTel traces back to Mushi data.

Health dashboard

After deploying, check Settings → Health in the admin console. It shows:

  • Provider probe status (Anthropic, OpenAI, Langfuse, Sentry, GitHub)
  • Recent LLM call latency and cost
  • Cron job last-run timestamps
  • Any degraded or error probes with actionable error codes
Last updated on