🎨 Improved otel code, cleaned up cjs polyfills - #810
Conversation
|
Warning Review limit reached
Next review available in: 16 minutes 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?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
WalkthroughThe project replaces automatic Node instrumentation with explicit HTTP and Undici packages, adds Fastify OpenTelemetry integration, and ignores selected health and informational paths. Both application variants register tracing before other plugins and routes, while Pub/Sub clients enable tracing. Server startup now uses dynamic application imports and Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/utils/instrumentation.ts`:
- Around line 30-34: Correct the service-name selection expression in the
instrumentation initialization so K_SERVICE is used when present, otherwise the
worker name is selected only when WORKER_MODE is strictly enabled, matching the
check in server.ts. Preserve the existing service-name values while fixing the
operator precedence that currently classifies every Cloud Run deployment as
analytics-worker.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ba60ce69-caab-4a41-a745-2c38b269a2ca
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (9)
package.jsonserver.tssrc/app.tssrc/services/events/publisher.tssrc/services/events/subscriber.tssrc/utils/cjs-polyfill.tssrc/utils/fastify-otel.tssrc/utils/instrumentation.tssrc/worker-app.ts
💤 Files with no reviewable changes (1)
- src/utils/cjs-polyfill.ts
b81d714 to
8696f7b
Compare
|
NOTE: we'll need to remove the required node 20 check before this can be merged. |
ref https://linear.app/ghost/issue/PLA-280/optimize-traffic-analytics-docker-buildself-hosting-execution - remove unused cjs polyfills, only referenced in a few spots that don't affect running behavior - fix otel tracing for pubsub + fastify - remove blanket node auto otel registration in favor of lighter-weight individual plugins - dropped node 20 from test matrix
8696f7b to
c4de090
Compare
|
FYI: Just rebased, resolved conflicts and force-pushed so I can deploy this to staging to test |
This is done — I've also pulled out the change to remove node 20 from the CI matrix into its own PR and merged it. |
|
✅ Deployed to staging (tree: 1f226d4b88dbddb0ea110a2cf987c1ac93b5cd77) |
ref https://linear.app/ghost/issue/PLA-280/optimize-traffic-analytics-docker-buildself-hosting-execution