Appearance
OpenCode
OpenCode has native OpenTelemetry support with the same event structure as Claude Code.
Automatic Setup
bash
flowstate-telemetry install --tool opencodeThis configures plugins and environment in ~/.config/opencode/opencode.json.
Manual Setup
Add the OTel environment variables to your shell profile (~/.zshrc or ~/.bashrc):
bash
export OTEL_EXPORTER_OTLP_ENDPOINT="https://otel.flowstate.inc"
export OTEL_EXPORTER_OTLP_HEADERS="x-flowstate-key=YOUR_TELEMETRY_KEY"What Gets Captured
| Event | OTel Name | Data Collected |
|---|---|---|
| User prompt | opencode.user_prompt | Prompt text, session ID |
| API request | opencode.api_request | Model, input/output/cache tokens, cost, duration |
| Tool result | opencode.tool_result | Tool name, success/failure, duration |
| API error | opencode.api_error | Error details |
TIP
OpenCode captures prompt content by default — there is no opt-in flag. It mirrors the Claude Code OTel event structure, providing the same rich metadata for session aggregation and classification.