Repository navigation
feat(ruby): Add feature flag support - #3108
Conversation
|
@sl0thentr0py What is needed in order to merge this PR? |
Add Sentry.add_feature_flag and Scope#add_feature_flag to record boolean flag evaluations. Flags are kept in a 100-entry LRU buffer on the scope, attached to error events as contexts.flags.values (not transactions), and recorded on the active span as flag.evaluation.* data (max 10 per span).
393157e to
87922d8
Compare
|
thx @jespersandnielsen, I'll make some small changes and then merge it |
40704bc to
f2b0e98
Compare
f2b0e98 to
28220bc
Compare
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 28220bc. Configure here.
| def set_flag(name, result) | ||
| flag = "#{SPAN_FLAG_ATTRIBUTE_PREFIX}#{name}" | ||
| @flags[flag] = result if @flags.size < MAX_FLAGS | ||
| end |
There was a problem hiding this comment.
Span flags skip updates at cap
Medium Severity
Once a span already holds 10 feature flags, set_flag rejects every write, including a new result for a name that is already stored. The scope buffer still keeps the latest evaluation, so error events and the active span can disagree on the same flag.evaluation.* value after a re-evaluation.
Reviewed by Cursor Bugbot for commit 28220bc. Configure here.
There was a problem hiding this comment.
matches python behavior 🤷 agree that the logic is a bit whatever


Add Sentry.add_feature_flag and Scope#add_feature_flag to record boolean flag evaluations. Flags are kept in a 100-entry LRU buffer on the scope, attached to error events as contexts.flags.values (not transactions), and recorded on the active span as flag.evaluation.* data (max 10 per span).
Thanks for your Pull Request 🎉
Please keep these instructions in mind so we can review it more efficiently:
feat:,fix:,ref:,meta:)Other Notes
Description
Describe your changes: