fix: opencode run does not emit OTLP traces even with experimental.openTelemetry enabled #9236

Open
opened 2026-02-16 18:11:58 -05:00 by yindo · 0 comments
Owner

Originally created by @bestend on GitHub (Feb 13, 2026).

Originally assigned to: @rekram1-node on GitHub.

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

  1. Enable OpenTelemetry feature in config:
    {
      "$schema": "https://opencode.ai/config.json",
      "experimental": {
        "openTelemetry": true
      }
    }
    
  2. Start local collector + jaeger (OTLP HTTP on :4318, gRPC on :4317).
  3. Send a manual OTLP trace to collector (POST /v1/traces) as control.
  4. 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
  5. 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:

  • #12142 (OTEL export capabilities)
  • #8193 (experimental_telemetry metadata regression)
  • #13171 (OTEL integration discussion)

This report is specifically about runtime emission behavior: collector path is verified healthy, but opencode spans are not emitted.

Originally created by @bestend on GitHub (Feb 13, 2026). Originally assigned to: @rekram1-node on GitHub. ## 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 1. Enable OpenTelemetry feature in config: ```json { "$schema": "https://opencode.ai/config.json", "experimental": { "openTelemetry": true } } ``` 2. Start local collector + jaeger (OTLP HTTP on `:4318`, gRPC on `:4317`). 3. Send a manual OTLP trace to collector (`POST /v1/traces`) as control. 4. 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` 5. 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: - #12142 (OTEL export capabilities) - #8193 (experimental_telemetry metadata regression) - #13171 (OTEL integration discussion) This report is specifically about runtime emission behavior: collector path is verified healthy, but opencode spans are not emitted.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9236