Skip to content

OpenCode Observability Stack

A self-contained observability stack for OpenCode, built on the @devtheops/opencode-plugin-otel plugin. Ships a Grafana dashboard with cost/token analytics, TraceQL-based explainability, and a standalone session timeline (waterfall) explorer.

Prerequisites

Features

  • Cost & token analytics — usage by model, agent, and session; breakdown by token type
  • Tool usage — call counts, average duration, and success rate per tool
  • Productivity — lines added/removed, message counts per session
  • TraceQL tables — LLM calls (prompt → model → outcome) and tool calls (tool → params → result)
  • Trace → Logs linking — click a span in Grafana to jump to matching Loki logs
  • Trace Explorer — React/FastAPI waterfall SPA with session timelines, subagent linking, and a cross-session usage dashboard
  • Dashboard filterssession_id, model, and agent template variables apply to every panel

Where to go next

License

MIT