feat: add scope merging mechanism - #1373
Conversation
8f6a8b4 to
e509cb6
Compare
e509cb6 to
5ea0d02
Compare
5ea0d02 to
2905cce
Compare
8b46a73 to
b3bd79f
Compare
b3bd79f to
5ab473f
Compare
5ab473f to
a27e5e5
Compare
a32be8d to
af060b8
Compare
5146682 to
80b661b
Compare
80b661b to
f1ba13c
Compare
| options := client.options | ||
| if !options.DisableMetrics { |
There was a problem hiding this comment.
Bug: The NewMeter and NewLogger functions no longer return no-op instances when the client is disabled, leading to unnecessary work.
Severity: MEDIUM
Suggested Fix
Reinstate the client.IsEnabled() check in the conditional logic for NewMeter in metrics.go and NewLogger in log.go. This will ensure that a no-op instance is returned when the client is disabled, preserving the original behavior and matching the documentation.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: metrics.go#L58-L59
Potential issue: The `client.IsEnabled()` check was removed from the `NewMeter` and
`NewLogger` factory functions. As a result, if the Sentry SDK is not initialized (e.g.,
no DSN is configured), these functions will now return real `sentryMeter` and
`sentryLogger` instances instead of the intended no-op versions. This causes unnecessary
CPU and memory usage to build metrics and logs that are ultimately discarded, and it
creates a mismatch between the code's behavior and its documentation, which states that
a no-op instance should be returned when the client is disabled.
Also affects:
log.go:63~64
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f1ba13c. Configure here.
2e3f4c5 to
bf26935
Compare

Description
Issues
Changelog Entry Instructions
To add a custom changelog entry, uncomment the section above. Supports:
For more details: custom changelog entries
Reminders
feat:,fix:,ref:,meta:)