Skip to content

[Bug]: OPENCODE_OTLP_PROTOCOL=http/protobuf` actually sends OTLP/JSON, breaks Arize Phoenix and other proto-only collectors #50

Description

@anthonyhull-ford

Description

When OPENCODE_OTLP_PROTOCOL=http/protobuf is set, the plugin sends spans/metrics/logs as JSON (Content-Type: application/json), not protobuf. Collectors that only accept OTLP/HTTP-protobuf (notably Arize Phoenix, which ingests on the same port as its UI) reject every export with 415 Unsupported Media Type.

The env-var name promises one transport, the wire format on the network is a different one. gRPC works fine; only the HTTP path is affected.

Steps to reproduce

  1. Run Phoenix locally:

    docker run --rm -p 6006:6006 -p 4317:4317 arizephoenix/phoenix:version-13.7.0
  2. Configure opencode to use the plugin over HTTP:

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@devtheops/opencode-plugin-otel"]
    }
    export OPENCODE_ENABLE_TELEMETRY=1
    export OPENCODE_OTLP_PROTOCOL=http/protobuf
    export OPENCODE_OTLP_ENDPOINT=http://localhost:6006
    opencode run "hello"
  3. Watch Phoenix logs:

    POST /v1/traces  ->  415  Unsupported content type: application/json
    

    Equivalent reproduction without opencode (matches what the plugin sends):

    $ curl -sS -X POST -H 'content-type: application/json' \
        --data-binary '{"resourceSpans":[]}' \
        -w "\nstatus=%{http_code}\n" \
        http://127.0.0.1:6006/v1/traces
    Unsupported content type: application/json
    status=415

    And what Phoenix does accept:

    $ curl -sS -X POST -H 'content-type: application/x-protobuf' \
        --data-binary '' -w "\nstatus=%{http_code}\n" \
        http://127.0.0.1:6006/v1/traces
    status=200

Expected behavior

With OPENCODE_OTLP_PROTOCOL=http/protobuf, exports should hit :6006/v1/traces with Content-Type: application/x-protobuf and an OTLP-protobuf payload. Spans should land in Phoenix.

Actual behavior

Exports are sent as Content-Type: application/json with an OTLP/JSON body. Phoenix rejects every request with 415. No spans are visible in the UI.

Plugin version

0.9.0

Configuration

@devtheops/opencode-plugin-otel 0.9.0 (latest on npm)

opencode 1.14.39

arizephoenix/phoenix version-13.7.0

macOS 25.4 (darwin), Node via Bun 1.2.17

Relevant log output

Checklist

  • I have searched existing issues to ensure this hasn't been reported
  • I have redacted any sensitive information (API keys, tokens, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions