-
Notifications
You must be signed in to change notification settings - Fork 3
Fix: Setup NewRelic based on config #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdded a Config flag to disable New Relic, gated New Relic setup in startup (errors now logged), threaded a distributed-tracing flag into New Relic initialization, and adjusted indirect dependencies in go.mod. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant App as App Startup
participant Env as Env / Config
participant NR as New Relic (SetupNewRelic)
participant OTel as OpenTelemetry Init
participant Log as Logger
App->>Env: load config (DISABLE_NEW_RELIC, tracing)
alt DISABLE_NEW_RELIC == false
App->>NR: call SetupNewRelic(tracing)
alt Setup succeeds
Note right of NR: New Relic configured\n(distributed tracing honored if tracing==true)
else Setup fails
NR-->>Log: log error from SetupNewRelic
App->>OTel: initialize OpenTelemetry fallback
end
else DISABLE_NEW_RELIC == true
Note right of App: New Relic setup skipped
App->>OTel: initialize OpenTelemetry (or other telemetry)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)core.go (1)
🔇 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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
config/config.go(1 hunks)core.go(2 hunks)initializers.go(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
core.go (1)
initializers.go (2)
SetupNewRelic(46-66)SetupNROpenTelemetry(293-309)
🔇 Additional comments (3)
initializers.go (1)
57-57: LGTM!The change correctly enables distributed tracing based on the
tracingparameter rather than a hardcoded value, providing runtime configurability.config/config.go (1)
33-34: LGTM!The new configuration field is properly documented and follows the existing config pattern.
core.go (1)
142-150: LGTM!Good practice to capture and log the error from
SetupNROpenTelemetryfor proper error visibility.
Summary by CodeRabbit
New Features
Refactor
Chores