You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: opencode run does not emit OTLP traces even with experimental.openTelemetry enabled #13438
opencode run does not produce any trace spans in a local OTEL collector, even when experimental.openTelemetry is enabled and OTEL exporter env vars are set.
In the same environment, manual OTLP trace ingestion works, so collector/backend path is healthy.
Environment
OpenCode version: 1.1.65
OS: macOS (darwin)
Local stack: OpenTelemetry Collector (otel/opentelemetry-collector-contrib:0.123.0) + Jaeger (jaegertracing/jaeger:2.4.0)
Not exactly the what is reported but I noticed that spans from opencode are always emitted as "opencode" - it appears OTEL_SERVICE_NAME has no effect. At least I could not find those traces while they were indeed working.
Root cause identified: process.exit() in the finally block of index.ts kills the process before the BatchSpanProcessor can flush buffered spans. AppRuntime.dispose() is never called, so the OTel SDK's shutdown/flush chain never runs.
Activity
strangemonad commentedon Mar 23, 2026
Related:
and many others https://github.com/anomalyco/opencode/pulls?q=is%3Apr+otel
maxkomarychev commentedon May 4, 2026
Not exactly the what is reported but I noticed that spans from opencode are always emitted as "opencode" - it appears
OTEL_SERVICE_NAMEhas no effect. At least I could not find those traces while they were indeed working.Trying to fix it here: #25739
astefanutti commentedon May 31, 2026
Root cause identified:
process.exit()in thefinallyblock ofindex.tskills the process before theBatchSpanProcessorcan flush buffered spans.AppRuntime.dispose()is never called, so the OTel SDK's shutdown/flush chain never runs.Fix: #30089
github-actions commentedon Jul 31, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.