GeezerVison is showing github.com — fix: opencode run does not emit OTLP traces even with experimental.openTelemetry enabled · Issue #13438 · anomalyco/opencode
fix: opencode run does not emit OTLP traces even with experimental.openTelemetry enabled #13438
Description
Summary
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)
Reproduction
- Enable OpenTelemetry feature in config:
{
"$schema": "https://opencode.ai/config.json",
"experimental": {
"openTelemetry": true
}
}
- Start local collector + jaeger (OTLP HTTP on
:4318, gRPC on :4317).
- Send a manual OTLP trace to collector (
POST /v1/traces) as control.
- Run opencode with OTEL env:
OTEL_TRACES_EXPORTER=otlp
OTEL_METRICS_EXPORTER=none
OTEL_LOGS_EXPORTER=none
OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf
OTEL_SERVICE_NAME=opencode-local-smoke
- Compare collector trace count and logs before/after.
Observed Result
- Baseline trace count:
1
- After manual OTLP control trace:
2 (as expected)
- After
opencode run: still 2 (no new trace)
- Collector debug logs only show manual services (
manual-curl-test, manual-control), no opencode service.
- Jaeger
/api/services also shows only manual test services.
Expected Result
With experimental.openTelemetry=true + OTEL exporter env vars, opencode run should emit spans to OTLP collector.
Additional Notes
Potentially related issues:
This report is specifically about runtime emission behavior: collector path is verified healthy, but opencode spans are not emitted.
Reacted by Artem Vozhdayenko and eberkut
Activity
strangemonad commented on Mar 23, 2026
maxkomarychev commented on 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_NAME has no effect. At least I could not find those traces while they were indeed working.
Trying to fix it here: #25739
astefanutti commented on May 31, 2026
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.
Fix: #30089
github-actions commented on 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.
Metadata
Metadata
Development
No branches or pull requestsIssue actions