anomalyco / anomalyco/opencode

[FEATURE]: Support enforced OTLP settings in managed configuration

Open
#47,351 3 comments 0 reactions 1 assignee View on GitHub

@neriousy is already working on this.

Since Sep 4, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

OpenCode supports system-managed configuration and macOS managed preferences, but its OTLP exporter is configured only through inherited environment variables:

  • OTEL_EXPORTER_OTLP_ENDPOINT
  • OTEL_EXPORTER_OTLP_HEADERS
  • OTEL_RESOURCE_ATTRIBUTES

This means an administrator cannot enforce an OTLP destination through /etc/opencode, %ProgramData%\opencode, or an ai.opencode.managed MDM profile. A user can unset or replace the environment variables when launching OpenCode.

Add dedicated managed OTLP settings:

{
  "telemetry": {
    "otlp": {
      "endpoint": "https://otel.example.com",
      "headers": "Authorization=Bearer token",
      "resourceAttributes": "deployment.environment.name=production"
    }
  },
  "experimental": {
    "openTelemetry": true
  }
}

Values present in the macOS ai.opencode.managed profile should have the highest precedence and should not be overridable by system-managed files, inherited environment variables, user configuration, or project configuration. For values omitted from the profile, the system-managed file should take precedence over inherited OTEL_* variables. Precedence should be evaluated per setting.

A dedicated OTLP block is preferable to a general managed env dictionary because it limits the capability to exporter settings OpenCode already supports.

Related: #12142, #25839

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.