fix: sentry profile lifecycle switch for controlplane#2251
fix: sentry profile lifecycle switch for controlplane#2251miklosbarabas merged 3 commits intomainfrom
Conversation
WalkthroughAdds a new SENTRY_PROFILE_LIFECYCLE environment variable, validates it in the env schema (enum "manual"|"trace" with default "manual"), exposes it on the Sentry config type, and passes it into Sentry.init; also updates the example .env. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (1)
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. 🧪 Early access (Sonnet 4.5): enabledWe are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience. Note:
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
controlplane/.env.example (1)
85-85: Remove quotes from the value and consider reordering.The value
"manual"should not be quoted in .env files unless the quotes are intended to be part of the value itself. Additionally, for consistency with the alphabetical ordering of other SENTRY_PROFILE_* variables, this line should come beforeSENTRY_PROFILE_SESSION_SAMPLE_RATE.Apply this diff:
SENTRY_TRACES_SAMPLE_RATE="1.0" -SENTRY_PROFILE_SESSION_SAMPLE_RATE="1.0" -SENTRY_PROFILE_LIFECYCLE="manual" +SENTRY_PROFILE_LIFECYCLE=manual +SENTRY_PROFILE_SESSION_SAMPLE_RATE="1.0" SENTRY_EVENT_LOOP_BLOCK_THRESHOLD_MS="100"Based on static analysis hints.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
controlplane/.env.example(1 hunks)controlplane/src/core/env.schema.ts(1 hunks)controlplane/src/core/sentry.config.ts(2 hunks)controlplane/src/index.ts(2 hunks)
🧰 Additional context used
🪛 dotenv-linter (3.3.0)
controlplane/.env.example
[warning] 85-85: [QuoteCharacter] The value has quote characters (', ")
(QuoteCharacter)
[warning] 85-85: [UnorderedKey] The SENTRY_PROFILE_LIFECYCLE key should go before the SENTRY_PROFILE_SESSION_SAMPLE_RATE key
(UnorderedKey)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: build_push_image
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (5)
controlplane/src/core/env.schema.ts (1)
206-206: LGTM!The schema validation correctly defines the enum with valid values
["manual", "trace"]and sets an appropriate default of"manual". This aligns with the Sentry SDK's expected values for profileLifecycle.controlplane/src/core/sentry.config.ts (2)
13-13: LGTM!The type definition correctly matches the enum values from the schema and follows the same pattern as other optional Sentry configuration fields.
30-30: LGTM!The profileLifecycle value is correctly passed through to Sentry.init, maintaining consistency with other configuration options.
controlplane/src/index.ts (2)
76-76: LGTM!The environment variable is correctly destructured from the parsed environment variables, following the same pattern as other Sentry configuration variables.
191-191: LGTM!The profileLifecycle value is correctly propagated from the environment variable to the Sentry configuration, completing the end-to-end flow for this feature.
Summary by CodeRabbit
New Features
Documentation
Checklist