Skip to content

feat(opencode): support managed OTLP exporter settings - #47353

Closed
lennyvaknine43 wants to merge 1 commit into
anomalyco:devfrom
lennyvaknine43:feat/managed-otel-config
Closed

lennyvaknine43 wants to merge 1 commit into
anomalyco:devfrom
lennyvaknine43:feat/managed-otel-config

Conversation

@lennyvaknine43

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #47351

Type of change

  • New feature
  • Documentation

What does this PR do?

Adds managed-only OTLP exporter settings for endpoint-managed OpenCode deployments:

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

OpenCode reads these values from the system-managed configuration directory and macOS ai.opencode.managed preferences before initializing observability.

Every value supplied by the macOS managed profile has the highest precedence. Profile values override the system-managed file and inherited OTEL_* environment variables. Values omitted from the profile may fall back to those lower-precedence sources.

User and project configuration cannot configure or redirect the managed OTLP exporter. Existing environment-only behavior remains unchanged when no managed OTLP settings are present.

How did you verify your code works?

  • bun typecheck in packages/core
  • bun typecheck in packages/opencode
  • bun test test/effect/observability.test.ts in packages/core
  • bun test test/config/config.test.ts in packages/opencode
  • bun run build in packages/web
  • Full pre-push monorepo typecheck
  • git diff --check

Tests cover managed OTLP parsing and managed settings overriding inherited process values.

Screenshots / recordings

N/A, configuration-only change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found two potentially related PRs (excluding the current PR #47353):

  1. PR feat: integrate OpenTelemetry #5245: feat: integrate OpenTelemetry

    • Related because it addresses OpenTelemetry integration, which is foundational to the managed OTLP exporter settings being added in this PR.
  2. PR fix: Respect OTEL variables #25841: fix: Respect OTEL variables

    • Related because it handles OTEL environment variables, which is directly relevant since the current PR mentions that managed settings override OTEL_* environment variables and describes the precedence hierarchy.

However, these appear to be older PRs addressing related but distinct aspects of observability. The current PR (47353) is specifically focused on adding managed-only OTLP configuration support for endpoint-managed deployments, which appears to be a new feature rather than a duplicate of existing work.

@rekram1-node

Copy link
Copy Markdown
Collaborator

We will definitely support this ty.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Support enforced OTLP settings in managed configuration

2 participants