Skip to content

feat(desktop): the process that starts the server reports what it did - #35

Merged
yordis merged 1 commit into
mainfrom
yordis/feat-desktop-honors-otel-environment
Aug 21, 2026
Merged

feat(desktop): the process that starts the server reports what it did#35
yordis merged 1 commit into
mainfrom
yordis/feat-desktop-honors-otel-environment

Conversation

@yordis

@yordis yordis commented Aug 21, 2026

Copy link
Copy Markdown
Member
  • The desktop app is two processes and only one of them was reachable. A user who configured a collector got the server and silently got nothing from the process that starts it, owns its windows, and restarts it when it dies. The most useful telemetry the desktop app can send is about the minutes before the server exists, and those were the minutes nothing was recorded.
  • The main process already had a real trace exporter, reachable only through a variable almost nobody sets, so it read as a feature that had been tried and found not to help. It had not been tried.
  • A telemetry variable that half an app honors is worse than one it ignores entirely, because the half that arrives looks like the whole. Both processes now read the same environment through the same module, so they cannot disagree about what a variable means.
  • The main process cannot be talked into filing its work under the server's name, so a fleet-wide OTEL_RESOURCE_ATTRIBUTES stays safe to set.
  • Fork ledger: docs/fork/0022-the-desktop-app-reports-its-own-work.md

The desktop app is two processes and only the server was reachable, so the minutes before the server exists went unrecorded, and the main process trace exporter that did exist read one variable almost nobody sets.

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

cursor Bot commented Aug 21, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes process-lifetime logging and OTLP export (including headers and collector destinations) in the Electron main process. Mis-assembly of the logger set could drop console output or telemetry, but this is not auth or data-store logic.

Overview
The Electron main process now reports its own work (startup, windows, backend supervision, updates) as traces, logs, and metrics under service name desktop, using the same OTEL_* sources and precedence as the server.

OtelEnvironment moves into @t3tools/shared/otelEnvironment so both processes cannot disagree about a variable. Desktop export is resolved once for all three signals (DesktopOtlpExport): T3CODE_OTLP_* / Settings take the whole signal (not just the URL); OTEL_SDK_DISABLED turns everything off; unsupported grpc declines only that signal. service.runtime is always desktop so ambient resource attributes cannot impersonate the server.

T3CODE_OTLP_METRICS_URL and T3CODE_OTLP_LOGS_URL are added; T3CODE_OTLP_EXPORT_INTERVAL_MS is optional so unset values fall back to the spec’s per-signal intervals. Logger, tracer, and metrics layers are assembled together because the main process has one logger set for its lifetime.

Reviewed by Cursor Bugbot for commit ee4fe57. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@yordis, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b8a67e80-6850-477c-aaea-f756e5f2daaf

📥 Commits

Reviewing files that changed from the base of the PR and between 59b824e and ee4fe57.

📒 Files selected for processing (20)
  • apps/desktop/src/app/DesktopConfig.ts
  • apps/desktop/src/app/DesktopEnvironment.test.ts
  • apps/desktop/src/app/DesktopEnvironment.ts
  • apps/desktop/src/app/DesktopObservability.ts
  • apps/desktop/src/app/DesktopOtlpExport.test.ts
  • apps/desktop/src/app/DesktopOtlpExport.ts
  • apps/server/src/bin.test.ts
  • apps/server/src/cli/config.test.ts
  • apps/server/src/cli/config.ts
  • apps/server/src/cli/pair.ts
  • apps/server/src/config.ts
  • apps/server/src/environment/ServerEnvironment.test.ts
  • apps/server/src/server.test.ts
  • apps/server/src/serverLogger.test.ts
  • docs/fork/0022-the-desktop-app-reports-its-own-work.md
  • docs/fork/README.md
  • docs/operations/observability.md
  • packages/shared/package.json
  • packages/shared/src/otelEnvironment.test.ts
  • packages/shared/src/otelEnvironment.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Aug 21, 2026
@yordis
yordis merged commit 38c5bc2 into main Aug 21, 2026
9 of 14 checks passed
@yordis
yordis deleted the yordis/feat-desktop-honors-otel-environment branch August 21, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 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.

1 participant