| title | Set Up Feature Flags |
|---|---|
| sidebar_title | Feature Flags |
| sidebar_order | 7000 |
| description | With Feature Flags, Sentry tracks feature flag evaluations in your application, keeps an audit log of feature flag changes, and reports any suspicious updates that may have caused an error. |
- You have the Python SDK installed.
If you use a third-party SDK to evaluate feature flags, you can enable a Sentry SDK integration to track those evaluations. Integrations are provider specific. Documentation for supported SDKs is listed below.
The generic API allows you to manually track feature flag evaluations. These evaluations are held in memory, and in the event an error occurs, sent to Sentry for review and analysis. Specifically, the generic integration enables users to integrate with proprietary (or otherwise unsupported) feature flagging solutions. At the moment, we only support boolean flag evaluations.
import sentry_sdk
from sentry_sdk.feature_flags import add_feature_flag
add_feature_flag('test-flag', False) # Records an evaluation and its result.
sentry_sdk.capture_exception(Exception("Something went wrong!"))Go to your Sentry project and confirm that your error event has recorded the feature flag "test-flag" and its value "false".