Skip to content

OpenTelemetry (OTEL) support similar to ClaudeCode? #14246

Closed

Description

@khaled4vokalz

Question

Hey,

I’ve been experimenting with OpenCode and was wondering whether there are plans to support OpenTelemetry (OTEL) natively, similar to how ClaudeCode handles it.

In ClaudeCode, telemetry can be enabled and configured entirely via standard OTEL environment variables, for example:

CLAUDE_CODE_ENABLE_TELEMETRY=1
OTEL_METRICS_EXPORTER=
OTEL_EXPORTER_OTLP_PROTOCOL=http/json
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=https://example.com
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer <foo-token>
[email protected]

With this setup, metrics are exported directly to an OTLP endpoint without any additional integration work in the client.

It seems like OpenCode doesn’t currently support OTEL in this way (at least not documented).

A few questions:

  • Is OTEL support on the roadmap?
  • Would you consider supporting the standard OTEL_* environment variables so telemetry can be wired up without code changes?
  • Is there a recommended way to plug in custom telemetry exporters today?

Having first-class OTEL support would make it much easier to integrate OpenCode into existing observability stacks (Prometheus, Grafana, etc.) and align with common instrumentation standards.

Thanks for the great work on the project. :)

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 19, 2026
  2. github-actions commented on Feb 19, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    You may want to add your input to those existing threads rather than opening a new one.

  3. flexdinesh commented on Mar 13, 2026

    @flexdinesh

    I like looking at beautiful dashboards and drawing conclusions on how I am using the tools at my disposal. It helps me understand my model and provider preference over time. Would love it if OpenCode would support exporting OTEL metrics. I use Zen for Moonshot and Z.AI models and would love to see how my usage trends with those models.

    Here's an example dashboard I use to observe my codex usage.

    Image
  4. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. rekram1-node commented on May 22, 2026

    @rekram1-node
    Collaborator

    We have OTEL support now:

    export OTEL_EXPORTER_OTLP_HEADERS=".........."
    export OTEL_EXPORTER_OTLP_ENDPOINT="................"
    export OTEL_RESOURCE_ATTRIBUTES="user.name=$(whoami)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions