File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 55
66
77class FeatureFlagsIntegration (Integration ):
8+ """
9+ Sentry integration for buffering feature flags manually with an API and capturing them on
10+ error events. We recommend you do this on each flag evaluation. Flags are buffered per Sentry
11+ scope and limited to 100 per event.
12+
13+ See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags)
14+ for more information.
15+
16+ @example
17+ ```
18+ import sentry_sdk
19+ from sentry_sdk.integrations.featureflags import FeatureFlagsIntegration, add_flag
20+
21+ sentry_sdk.init(dsn="my_dsn", integrations=[FeatureFlagsIntegration()]);
22+
23+ add_flag('my-flag', true);
24+ sentry_sdk.capture_exception(Exception('broke')); // 'my-flag' should be captured on this Sentry event.
25+ ```
26+ """
27+
828 identifier = "featureflags"
929
1030 @staticmethod
@@ -14,5 +34,9 @@ def setup_once():
1434
1535
1636def add_flag (flag : str , result : bool ):
37+ """
38+ Records a flag and its value to be sent on subsequent error events. We recommend you do this
39+ on flag evaluations. Flags are buffered per Sentry scope and limited to 100 per event.
40+ """
1741 flags = sentry_sdk .get_current_scope ().flags
1842 flags .set (flag , result )
You can’t perform that action at this time.
0 commit comments