Skip to content

[FEATURE]: Support enforced OTLP settings in managed configuration #47351

Open

Description

@lennyvaknine43

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

Activity

  1. github-actions commented on Sep 4, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Feature requests must have a title starting with [FEATURE]: (e.g. [FEATURE]: Support enforced OTLP settings in managed configuration)
    • Feature requests require a verification checkbox confirming the feature doesn't already exist and hasn't been requested before

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

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

  2. changed the title [-]Support enforced OTLP settings in managed configuration[/-] [+][FEATURE]: Support enforced OTLP settings in managed configuration[/+] on Sep 4, 2026
  3. lennyvaknine43 commented on Sep 4, 2026

    @lennyvaknine43
    ContributorAuthor

    Updated the title and body to use the feature-request format and added the required duplicate-verification checkbox.

  4. github-actions commented on Sep 4, 2026

    @github-actions
    Contributor

    Thank you for updating the issue! It now follows the feature request template and includes a clear description of the problem and proposed solution. The needs:compliance label has been removed.

  5. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the detailed request, @lennyvaknine43! You're asking for dedicated telemetry.otlp settings (endpoint, headers, resource attributes) in managed configuration, so that administrators can enforce an OTLP destination through system-managed files or the macOS ai.opencode.managed profile. Precedence would be evaluated per setting, and users wouldn't be able to override these values with OTEL_* environment variables or their own config.

    I checked the current v2 code. The exporter is configured only from OTEL_EXPORTER_OTLP_ENDPOINT / OTEL_EXPORTER_OTLP_HEADERS when the CLI starts, so this isn't possible today. A plugin can't fill the gap either: it loads after the exporter is set up, and the user could disable it.

    Related issues and PRs:

    Maintainers will consider this request.

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