Persist server OTLP tracing settings across restarts#1705
Persist server OTLP tracing settings across restarts#1705juliusmarminge merged 4 commits intomainfrom
Conversation
- Add shared observability settings parsing and schema support - Load persisted OTLP traces URL in the server and desktop bootstrap - Update UI defaults and tests for settings persistence Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
- Persist metrics URL alongside traces URL - Thread metrics config through desktop and server bootstrap
ApprovabilityVerdict: Needs human review This PR introduces a new capability (persisting OTLP observability settings across restarts) that modifies how the desktop app configures the backend on startup. While the implementation is clean with good test coverage, the addition of new persistent state and changes to the startup flow warrant human review to confirm the behavior matches expectations. You can customize Macroscope's approvability policy. Learn more. |
- Remove `T3CODE_OTLP_METRICS_URL` from backend child env - Default persisted observability settings to include `otlpMetricsUrl`
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Summary
otlpTracesUrlfrom env vars, bootstrap data, or persisted settings so desktop/server restarts retain tracing config.Testing
packages/shared/src/serverSettings.test.tsfor persisted observability parsing and normalization.apps/server/src/cli-config.test.tsandapps/server/src/serverSettings.test.tsfor config precedence and settings persistence.Note
Medium Risk
Updates server config resolution and desktop backend bootstrap behavior to source OTLP endpoints from persisted
settings.json, which can affect telemetry/export behavior and startup/restart flows. Also changes desktop backend shutdown handling to avoid unintended restarts, which could impact reliability if misclassified exits occur.Overview
Persists OTLP observability endpoints (
otlpTracesUrl,otlpMetricsUrl) inServerSettingsand introduces shared helpers (@t3tools/shared/serverSettings) to leniently parse/normalize these values from the on-disksettings.json.Server startup config now resolves OTLP URLs with precedence env vars → desktop bootstrap envelope → persisted settings file, and the desktop app reads the persisted settings on launch/restart and injects OTLP URLs into the backend bootstrap payload so tracing config survives restarts.
Desktop backend lifecycle handling is adjusted to track intentionally-stopped child processes (
expectedBackendExitChildren) sostopBackend/stopBackendAndWaitForExitno longer trigger automatic restart logic; tests are added/updated to cover parsing, trimming-on-save, and precedence behavior.Written by Cursor Bugbot for commit a0effd5. This will update automatically on new commits. Configure here.
Note
Persist server OTLP tracing settings across restarts
ObservabilitySettings(withotlpTracesUrlandotlpMetricsUrl) to theServerSettingsschema in settings.ts and exposes reusable parsing helpers in serverSettings.ts.STATE_DIR/settings.jsonbefore spawning the backend and injects the URLs into the bootstrap envelope.resolveServerConfigresolves OTLP URLs with explicit precedence: environment variables → bootstrap envelope → persisted settings file.WeakSetin main.ts.Macroscope summarized a0effd5.