Skip to content

Commit 36bc869

Browse files
committed
Add docstrs
1 parent 4651b6a commit 36bc869

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

sentry_sdk/integrations/featureflags.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@
55

66

77
class 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

1636
def 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)

0 commit comments

Comments
 (0)