feat: report feature flag evaluation to Sentry#117
Open
bardiharborow wants to merge 1 commit into
Open
Conversation
This commit adds custom feature flag classes to django-waffle that report feature flag evaluation to Sentry. Sentry attaches the reported flags to error and transaction events for the current request, making it possible to see which feature flags were active when an error occurred.
a-musing-moose
requested changes
Jun 11, 2026
a-musing-moose
left a comment
Contributor
There was a problem hiding this comment.
Aside from the failing test and the module import convention thing, this looks good.
Since we now have both waffle and this new flags app in INSTALLED_APPS does that mean admin will show both sets of models? Is there any way to avoid that?
|
|
||
| from django.http import HttpRequest | ||
| from sentry_sdk.feature_flags import add_feature_flag | ||
| from waffle.models import ( |
Contributor
There was a problem hiding this comment.
Issue: Please import modules, not individual properties
As per Python Coding Conventions we want to preference the importing of modules. The odd single import (like HttpRequest) is fine, but when you start needing multiple lines I would prefer to enforce this convention.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds custom feature flag classes to django-waffle that report feature flag evaluation to Sentry. Sentry attaches the reported flags to error and transaction events for the current request, making it possible to see which feature flags were active when an error occurred.
See also: https://docs.sentry.io/product/issues/issue-details/feature-flags/