-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Open
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)
Description
- I have verified this feature I'm about to request hasn't been suggested before.
Summary
Please add first-class OpenTelemetry support so OpenCode can export telemetry (logs/events, and optionally traces/metrics) to standard OTLP backends.
Why this matters
Teams running OpenCode in CI/dev environments need observability for:
- tool usage and outcomes
- model request latency/cost/token usage
- agent/subtask lifecycle
- failure/error rates
OpenTelemetry is the standard integration path for Grafana, Datadog, Honeycomb, etc.
Proposed config
{
"otel": {
"enabled": true,
"endpoint": "http://otel-collector:4318",
"protocol": "http/protobuf",
"headers": {
"authorization": "{env:OTEL_AUTH_HEADER}"
},
"serviceName": "opencode",
"resourceAttributes": {
"env": "dev"
},
"signals": {
"logs": true,
"metrics": true,
"traces": true
}
}
}Desired telemetry model
At minimum:
- session start/stop events
- tool invocation + tool result events (duration, success/failure)
- model/API request events (provider/model, latency, tokens, estimated cost)
- error events with error class/code
Optional but valuable:
- trace spans for session -> task -> tool/model call hierarchy
- aggregate metrics (token usage, request counts, active sessions, tool failure rates)
Acceptance criteria
- Documented
otelconfig (endpoint/protocol/headers/resource attrs) - OTLP export works with local OpenTelemetry Collector
- Sensitive payload controls (prompt/tool arg redaction toggles)
- Stable event/attribute naming documented
- Example dashboards/queries in docs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)