Skip to content

[FEATURE]: Native OpenTelemetry (OTLP) export for OpenCode sessions/tools/events #14697

Closed

Description

@cruzanstx
  • I have verified this feature I'm about to request hasn't been suggested before.

Summary

Please add first-class OpenTelemetry support so OpenCode can export telemetry (logs/events, and optionally traces/metrics) to standard OTLP backends.

Why this matters

Teams running OpenCode in CI/dev environments need observability for:

  • tool usage and outcomes
  • model request latency/cost/token usage
  • agent/subtask lifecycle
  • failure/error rates

OpenTelemetry is the standard integration path for Grafana, Datadog, Honeycomb, etc.

Proposed config

{
  "otel": {
    "enabled": true,
    "endpoint": "http://otel-collector:4318",
    "protocol": "http/protobuf",
    "headers": {
      "authorization": "{env:OTEL_AUTH_HEADER}"
    },
    "serviceName": "opencode",
    "resourceAttributes": {
      "env": "dev"
    },
    "signals": {
      "logs": true,
      "metrics": true,
      "traces": true
    }
  }
}

Desired telemetry model

At minimum:

  • session start/stop events
  • tool invocation + tool result events (duration, success/failure)
  • model/API request events (provider/model, latency, tokens, estimated cost)
  • error events with error class/code

Optional but valuable:

  • trace spans for session -> task -> tool/model call hierarchy
  • aggregate metrics (token usage, request counts, active sessions, tool failure rates)

Acceptance criteria

  • Documented otel config (endpoint/protocol/headers/resource attrs)
  • OTLP export works with local OpenTelemetry Collector
  • Sensitive payload controls (prompt/tool arg redaction toggles)
  • Stable event/attribute naming documented
  • Example dashboards/queries in docs

Activity

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

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Feature requests should use the [FEATURE]: prefix in the title (e.g. [FEATURE]: Native OpenTelemetry (OTLP) export...)
    • The feature request template requires a verification checkbox confirming the feature was searched for and not already requested

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


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

    If you believe this was flagged incorrectly, please let a maintainer know.

  3. changed the title [-]Feature: Native OpenTelemetry (OTLP) export for OpenCode sessions/tools/events[/-] [+][FEATURE]: Native OpenTelemetry (OTLP) export for OpenCode sessions/tools/events[/+] on Feb 22, 2026
  4. cruzanstx commented on Feb 22, 2026

    @cruzanstx
    Author

    Updated per template requirements: title now uses and the verification checkbox is included at the top. I also noted this may overlap with #14246/#12142/#13171 if maintainers prefer consolidation.

  5. cruzanstx commented on Feb 22, 2026

    @cruzanstx
    Author

    Correction: title now uses [FEATURE]: prefix and the required verification checkbox is included at the top. This may overlap with #14246/#12142/#13171 if maintainers want consolidation.

  6. github-actions commented on Feb 22, 2026

    @github-actions
    Contributor

    Thanks for updating the issue! It now meets our contributing guidelines. The needs:compliance label has been removed.

  7. github-actions commented on Apr 24, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  8. ef-anrainer commented on Apr 24, 2026

    @ef-anrainer

    Was this closed intentionally?
    Or let me rephrase the question:
    What’s the current plan/progress on the native OpenTelemetry implementation?

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions