Skip to content

feat: configure Codex telemetry and Claude traces - #6007

Merged
tgmendes merged 5 commits into
mainfrom
feat/plugin-native-otel
Sep 4, 2026
Merged

feat: configure Codex telemetry and Claude traces#6007
tgmendes merged 5 commits into
mainfrom
feat/plugin-native-otel

Conversation

@tgmendes

@tgmendes tgmendes commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • configure downloaded Codex install scripts to send native OpenTelemetry logs, traces, and metrics to Gram with a generated hooks key
  • enable Claude Code enhanced telemetry and OTLP trace export in managed setup settings
  • use OTLP HTTP/protobuf for both clients, matching Gram's generic ingestion decoder
  • preserve existing Codex exporters per signal and cover generated TOML plus the authenticated download path

Motivation

The observability plugins already capture hook events, but Codex's quick installer does not configure its native OpenTelemetry exporters and Claude tracing remains disabled. This routes native Codex and Claude OTLP signals through Gram's generic telemetry ingestion path.

Why the endpoint is /otel

OTLP exporters treat the configured value as a base URL and append /v1/logs, /v1/metrics, or /v1/traces. Configuring https://app.getgram.ai/otel therefore targets Gram's generic /otel/v1/* ingestion routes.

The previous https://app.getgram.ai/rpc/hooks.otel base was not provider-neutral: /rpc/hooks.otel/v1/traces is owned by the legacy LiteLLM trace handler. That handler stamps accepted spans with hook_source = "litellm", the litellm:otel:traces resource URN, and LiteLLM tool metadata regardless of the producer's incoming service.name. Claude traffic sent there could therefore appear as LiteLLM even though it never traversed a LiteLLM proxy.

The generic /otel/v1/traces path preserves the producer's OTLP resource attributes, and downstream source attribution derives from service.name, allowing Claude Code telemetry to remain attributed to Claude Code. Claude is configured with http/protobuf and Codex with binary, so their payloads match these routes' protobuf decoder.

@tgmendes
tgmendes requested review from a team as code owners September 3, 2026 10:28
@changeset-bot

changeset-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fdad285

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@tgmendes tgmendes added enhancement New feature or request go Pull requests that update go code javascript Pull requests that update javascript code labels Sep 3, 2026
@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Running ultrareview automatically — This PR rewrites the Codex install script generator to embed OTLP telemetry and API keys into users' config.toml, adds new API-key persistence, and changes Claude managed settings—any subtle bug could corrupt user configs or break installs, so a deep review is warranted.. I'll post findings when complete.

@tgmendes

tgmendes commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Demo

Claude Code managed settings

Claude Code trace configuration

What it shows:

  1. The managed settings flow now calls out logs, metrics, and traces.
  2. The generated JSON enables enhanced telemetry and sets OTEL_TRACES_EXPORTER to otlp.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultrareview completed in 15m 45s

All reported issues were addressed across 7 files

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread server/internal/plugins/generate.go Outdated
Comment thread client/dashboard/src/pages/setup/setup-data.ts
Comment thread server/internal/plugins/generate.go
Comment thread client/dashboard/src/pages/plugins/InstallInstructionsDialog.tsx Outdated
Comment thread server/internal/plugins/generate.go Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files (changes from recent commits).

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.

Fix all with cubic | Re-trigger cubic

Comment thread server/internal/plugins/generate.go Outdated
Comment thread server/internal/plugins/impl_test.go

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 7 files (changes from recent commits).

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread server/internal/plugins/generate.go Outdated
Comment thread server/internal/plugins/impl_test.go
Comment thread client/dashboard/src/pages/setup/setup-data.test.ts Outdated
@tgmendes
tgmendes added this pull request to the merge queue Sep 4, 2026
Merged via the queue into main with commit c56cf43 Sep 4, 2026
45 of 46 checks passed
@tgmendes
tgmendes deleted the feat/plugin-native-otel branch September 4, 2026 08:07
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request go Pull requests that update go code javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants