Skip to content

fix(observability): a malformed OTEL_RESOURCE_ATTRIBUTES no longer stops startup - #13469

Merged
juliusmarminge merged 4 commits into
pingdotgg:mainfrom
yordis:yordis/fix-otel-resource-attributes
Sep 24, 2026
Merged

juliusmarminge merged 4 commits into
pingdotgg:mainfrom
yordis:yordis/fix-otel-resource-attributes

Conversation

@yordis

@yordis yordis commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor
  • With OTLP export configured, an OTEL_RESOURCE_ATTRIBUTES that cannot be percent-decoded (for example team=%zz) makes the exporter's own read of that variable die, so the server or desktop app fails to start over an optional tag.
  • An environment variable is often set machine-wide for other tools, so T3 Code should not refuse to start over it. The kill switch already treats bad values this way: ignore them and warn once at startup.
  • The variable is read with the same Config.Record schema the exporters use, so "accepted" means exactly what they would have accepted, and a list they would have died on is ignored as a whole with a warning naming it.
  • This is the resource-attribute slice of feat(observability): honor the standard OTEL_* environment variables #12621, split out to be small enough to review on its own.

Summary by CodeRabbit

  • New Features
    • OpenTelemetry resource attributes can now be configured through OTEL_RESOURCE_ATTRIBUTES and applied to application telemetry, including logs, traces, and metrics.
    • Percent-encoded keys and values are supported. Invalid attribute settings fall back to an empty set and produce a warning.
    • These attributes are available in both desktop and server telemetry, keeping resource metadata consistent across supported application signals.

…ops startup

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 24, 2026
Comment thread packages/shared/src/otelEnvironment.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 9a8ed8e

Macroscope's review found this PR approvable — This is a focused observability startup fix that sanitizes malformed OTEL_RESOURCE_ATTRIBUTES values while preserving existing behavior when the variable is unset or valid. Server and desktop integrations are limited to existing telemetry layers, with tests covering the new parsing and fallback behavior.

You can add or adjust custom eligibility rules. Learn more.

… own Config

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Sep 24, 2026
Comment thread packages/shared/src/otelEnvironment.ts Outdated
… warning

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>

@macroscopeapp macroscopeapp 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 clear

Posted via Macroscope — Effect Service Conventions

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 24, 2026
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 0d047dee-6a82-4734-b0ff-bb050008b8a6

📥 Commits

Reviewing files that changed from the base of the PR and between f26ee08 and c507b5c.

📒 Files selected for processing (4)
  • apps/desktop/src/app/DesktopObservability.ts
  • apps/server/src/observability/Layers/Observability.ts
  • packages/shared/src/otelEnvironment.test.ts
  • packages/shared/src/otelEnvironment.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The shared OTel environment now parses OTEL_RESOURCE_ATTRIBUTES and provides accepted attributes through a config layer. Desktop and server observability compositions apply that layer, and tests cover parsing and exporter configuration reads.

Changes

OTel Resource Attributes

Layer / File(s) Summary
Parse and provide resource attributes
packages/shared/src/otelEnvironment.ts, packages/shared/src/otelEnvironment.test.ts
OtelEnvironment now exposes decoded resource attributes and includes warnings for malformed values. resourceAttributesLayer provides accepted attributes through OTEL_RESOURCE_ATTRIBUTES. Tests cover unset, encoded, and malformed values, plus exporter reads.
Provide attributes to observability layers
apps/desktop/src/app/DesktopObservability.ts, apps/server/src/observability/Layers/Observability.ts
Desktop endpoint resolution carries resource attributes in both branches. Desktop and server layer compositions provide those attributes to observability layers.

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

sequenceDiagram
  participant OtelEnvironment
  participant DesktopObservability
  participant ServerObservability
  participant OtlpResource
  OtelEnvironment->>DesktopObservability: parsed resourceAttributes
  DesktopObservability->>OtlpResource: provide resourceAttributesLayer
  ServerObservability->>OtlpResource: provide configured resourceAttributesLayer
Loading

Suggested reviewers: juliusmarminge, bahlo

Merge Risk: ⚪ Minimal · up to c507b

The change appears ready to merge after normal checks: malformed resource attributes are ignored with a warning, while accepted attributes remain available to telemetry exporters.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main fix: malformed OTEL_RESOURCE_ATTRIBUTES values no longer prevent startup.
Description check ✅ Passed The description explains what changed, why the change is needed, and the intended behavior. It does not use the template headings or include the checklist, but the required information is mostly prese…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

Comment thread packages/shared/src/otelEnvironment.ts Outdated
…e repo names layers

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@macroscopeapp
macroscopeapp Bot dismissed their stale review September 24, 2026 19:05

Dismissing prior approval to re-evaluate 9a8ed8e

Comment on lines +85 to +86
Config.String(RESOURCE_ATTRIBUTES).pipe(
// The value is left out because attributes can carry credentials.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: seems like a usecase for Config.Redacted then, no?

@juliusmarminge
juliusmarminge merged commit 87d8428 into pingdotgg:main Sep 24, 2026
22 of 23 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 25, 2026
## What's Changed
* lint/unknown and static by @juliusmarminge in pingdotgg/t3code#13366
* fix(web): web colors come from theme tokens by @juliusmarminge in pingdotgg/t3code#13371
* fix(web): appearance classes use theme tokens and scale values by @juliusmarminge in pingdotgg/t3code#13397
* fix(server): keep Codex's reset answer when the re-probe fails by @juliusmarminge in pingdotgg/t3code#13363
* fix(mobile): branch search finds remote and space-typed branches by @Bil0000 in pingdotgg/t3code#13454
* chore(ci): use GPT 6 Sol Max for check agents by @juliusmarminge in pingdotgg/t3code#13473
* feat(server): show and redeem Claude banked resets by @Bil0000 in pingdotgg/t3code#13118
* fix(observability): a malformed OTEL_RESOURCE_ATTRIBUTES no longer stops startup by @yordis in pingdotgg/t3code#13469
* fix(antigravity): let Stop end commands that outlived their turn by @juliusmarminge in pingdotgg/t3code#13388
* fix(web,mobile): drop the baked-in tile from the Antigravity icon by @flamboh in pingdotgg/t3code#13373
* fix(marketing): use the official OpenCode and Antigravity logos by @flamboh in pingdotgg/t3code#13365
* fix(acp): keep one answer when a running tool reports progress by @juliusmarminge in pingdotgg/t3code#13386
* feat(web): run shell commands from chat in the thread terminal by @Bil0000 in pingdotgg/t3code#13060
* fix(antigravity): keep Windows runtime unpacking under MAX_PATH by @juliusmarminge in pingdotgg/t3code#13389
* fix(codex): the protocol generator runs again on Effect rc.115 by @juliusmarminge in pingdotgg/t3code#13480
* feat(codex): require Codex 0.156 and regenerate its protocol by @juliusmarminge in pingdotgg/t3code#13481
* feat(threads): add per-thread auto-settle switch by @t3dotgg in pingdotgg/t3code#11846
* fix(web): working and monitoring threads fade in the sidebar again by @t3dotgg in pingdotgg/t3code#13506
* fix(server): streamed section titles wait for the text under them by @t3dotgg in pingdotgg/t3code#13504
* fix(web): normalize disabled control opacity by @t3-code[bot] in pingdotgg/t3code#11441


**Full Changelog**: pingdotgg/t3code@v0.0.43-nightly.20260924.2213...v0.0.43-nightly.20260924.2223

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.43-nightly.20260924.2223
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants