-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(flags): document python FeatureFlagsIntegration for custom flag tracking #12152
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
Changes from 10 commits
2f1b54f
426d321
d7c9ef2
c43046d
e7bff6c
4470aa5
4425f56
1cf8a9c
1b9b310
7a3ab75
0fd26ac
a1d8adf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --- | ||
| title: Feature Flags | ||
| description: "Learn how to attach custom feature flag data to Sentry error events." | ||
| --- | ||
|
|
||
| <PlatformContent includePath="feature-flags/prerelease-alert" /> | ||
|
|
||
| The Feature Flags integration allows you to manually track feature flag evaluations through an API. These evaluations are held in memory, and in the event an error occurs, sent to Sentry for review and analysis. | ||
| **At the moment, we only support boolean flag evaluations.** | ||
|
|
||
| ## Install | ||
|
|
||
| Install `sentry-sdk` (>=TODO:) from PyPI. | ||
|
|
||
| ```bash | ||
| pip install --upgrade 'sentry-sdk' | ||
| ``` | ||
|
|
||
| ## Configure | ||
|
|
||
| Add `FeatureFlagsIntegration()` to your `integrations` list: | ||
|
|
||
| ```python | ||
| import sentry_sdk | ||
| from sentry_sdk.integrations.featureflags import FeatureFlagsIntegration | ||
|
||
|
|
||
| sentry_sdk.init( | ||
| dsn="___PUBLIC_DSN___", | ||
| integrations=[ | ||
| FeatureFlagsIntegration(), | ||
| ], | ||
| ) | ||
| ``` | ||
|
|
||
| ## Verify | ||
|
|
||
| The integration is tested by calling the `add_feature_flag` API before capturing an exception. | ||
|
|
||
| ```python | ||
| import sentry_sdk | ||
| from sentry_sdk.integrations.featureflags import add_feature_flag | ||
|
|
||
| add_feature_flag('test-flag', False) | ||
|
|
||
| sentry_sdk.capture_exception(Exception("Something went wrong!")) | ||
| ``` | ||
|
|
||
| Visit the Sentry website and confirm that your error event has recorded the feature flag "test-flag" and its value "false". | ||
|
|
||
| <PlatformContent includePath="feature-flags/next-steps" /> | ||
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.
TODO after release!