opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(telemetry): add OpenTelemetry instrumentation with Aspire Dashboard support

Open Hona opened this issue 2 weeks ago • 2 comments

Adds experimental OpenTelemetry support for debugging and observability.

What

  • Full OTEL instrumentation: all tools, MCP, sessions, LLM, LSP, plugins
  • Aspire Dashboard integration via bun run dev:otel
  • Service differentiation: opencode-cli vs opencode-server
  • Structured logs with full key=value context + exception stack traces
  • AI SDK telemetry with GenAI message content capture

Enabling OpenTelemetry

  1. Add to your global config (~/.config/opencode/opencode.json:
{
  "experimental": {
    "openTelemetry": true
  }
}
  1. Run with Aspire Dashboard:
cd packages/opencode
bun run dev:otel
  1. Open dashboard at http://localhost:18888

The OTEL_EXPORTER_OTLP_ENDPOINT env var controls the endpoint (defaults to http://localhost:4317).

Images

image image image image image image image

Hona avatar Jan 02 '26 07:01 Hona