Repository navigation
Default to lean Logfire telemetry - #224
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues remain, and the configuration, lifecycle behavior, tests, and documentation consistently support the intended telemetry profiles.
0 open findings
What changed in this PR
Reduces default Logfire ingestion for the API and standalone workers while preserving application traces and bounded shutdown.
Changes:
- Defaults to lean telemetry with minute-resolution snapshots and no metric exports.
- Adds diagnostic metric opt-in and bounded sampling overrides; removes cgroup sampling and routine success logs.
- Updates export tests and operational guidance.
| File | Description |
|---|---|
| packages/server/telemetry.ts | Applies profiles to shared telemetry setup. |
| packages/server/telemetry-settings.ts | Resolves profiles and sampling intervals. |
| packages/server/telemetry-settings.test.ts | Tests defaults, opt-in, and interval bounds. |
| packages/server/telemetry-sdk-compatibility.test.ts | Isolates SDK compatibility checks. |
| packages/server/telemetry-export.test.ts | Verifies real-SDK exports for both profiles. |
| packages/server/runtime-telemetry.ts | Simplifies sampling and makes gauges optional. |
| packages/server/runtime-telemetry.test.ts | Tests sampling, gauges, and cleanup. |
| packages/server/process-telemetry.test.ts | Checks shared lean configuration. |
| packages/server/middleware/authenticate-space.ts | Removes authentication-success logging. |
| packages/server/handlers/health.ts | Removes heartbeat logging. |
| packages/server/handlers/health.test.ts | Verifies health checks emit no routine logs. |
| DEVELOPMENT.md | Adds profile deployment guidance. |
| design/runtime-observability.md | Documents profiles and infrastructure correlation. |
| design/README.md | Updates observability document scope. |
| design/embedding-queue-and-worker.md | Clarifies tokenizer telemetry behavior. |
| .env.sample | Documents profile and interval settings. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LOGFIRE_TELEMETRY_PROFILE=diagnosticfor explicit application metric opt-in and 10-second snapshots; both profiles keep automatic V8/cgroup telemetry disabled.LOGFIRE_RUNTIME_SAMPLE_INTERVAL_MS, deployment guidance, and isolated real-SDK export tests.Motivation
Today’s Logfire ingestion review measured 233,633 metric points/hour across dev and prod, versus 2,120/hour before the rollout. Automatic V8 heap-space metrics accounted for 61.5% of the later hour; 48 zero-only series represented 56.8%. Existing Kubernetes metrics cover infrastructure health without duplicating it in Logfire. These are observed ingestion counts, not billing estimates.
Validation
./bun run check:fullpassed against local PostgreSQL, including 33 CLI end-to-end tests.git diff --checkpassed.Rollout
Deploy this PR SHA to dev after CI passes, then verify pod health and fresh Logfire ingestion. Production and version release are intentionally separate steps.