Skip to content

Commit 2402fdf

Browse files
authored
Revert "fix(flags): unpublish docs on unreleased python integrations (#12296)"
This reverts commit 6d3fd15.
1 parent 6d3fd15 commit 2402fdf

File tree

5 files changed

+121
-2
lines changed

5 files changed

+121
-2
lines changed

docs/organization/integrations/feature-flag/generic/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ To set up evaluation tracking, visit the [explore page](/product/explore/feature
1414

1515
To set up generic evaluation tracking, visit one of our supported languages' pages:
1616
* [JavaScript](/platforms/javascript/configuration/integrations/generic/)
17+
* [Python](/platforms/python/integrations/feature-flags/generic/)
1718

1819
## Change Tracking
1920

docs/organization/integrations/feature-flag/unleash/index.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ description: Learn about Sentry's Unleash integrations.
66

77
## Evaluation Tracking
88

9-
Support for this is coming soon, starting with [Python sentry-sdk](https://pypi.org/project/sentry-sdk/).
9+
Sentry can track flag evaluations as they happen within your application. Flag evaluations will appear in the "Feature Flag" section of the Issue Details page as a table, with "suspect" flag predictions highlighted in yellow. Learn more about how to interact with feature flag insights within the Sentry UI by reading the [Issue Details page documentation](/product/issues/issue-details/#feature-flags).
10+
11+
### Set Up Evaluation Tracking
12+
13+
To set up evaluation tracking, visit one of our supported languages pages:
14+
* [Python](/platforms/python/integrations/feature-flags/unleash/)
1015

1116
## Change Tracking
1217

@@ -20,7 +25,7 @@ Enabling Change Tracking is a three-step process. To get started visit the [feat
2025
- One webhook secret can be registered per provider type.
2126
- Select Unleash in the dropdown that says "Select a provider".
2227
2. **Register the webhook URL**.
23-
- Go to your Unleash homepage and navigate to the `/integrations/` page, which can be found by clicking Integrations on the left-hand sidebar navigation, under the Configure heading.
28+
- Go to your Unleash homepage and navigate to the `/integrations/` page, which can be found by clicking Integrations on the left-hand sidebar navigation, under the Configure heading.
2429
- Select the Webhook option. You should be on the `/integrations/create/webhook/` page.
2530
- Copy the provided Sentry webhook URL in settings and paste it into Unleash within their webhook integration UI.
2631
- Make sure the integration is toggled to Enabled.

docs/platforms/python/feature-flags/index.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@ Evaluation tracking requires enabling an SDK integration. Integrations are provi
1616

1717
- [OpenFeature](/platforms/python/integrations/feature-flags/openfeature/)
1818
- [LaunchDarkly](/platforms/python/integrations/feature-flags/launchdarkly/)
19+
- [Unleash](/platforms/python/integrations/feature-flags/unleash/)
20+
- [Generic](/platforms/python/integrations/feature-flags/generic/)
1921

2022
<PlatformContent includePath="feature-flags/enable-change-tracking" />
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: Generic
3+
description: "Learn how to attach custom feature flag data to Sentry error events."
4+
---
5+
6+
<PlatformContent includePath="feature-flags/prerelease-alert" />
7+
8+
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. 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.**
9+
10+
## Install
11+
12+
Install `sentry-sdk` from PyPI.
13+
14+
```bash
15+
pip install --upgrade 'sentry-sdk'
16+
```
17+
18+
## Configure
19+
20+
Add `FeatureFlagsIntegration()` to your `integrations` list:
21+
22+
```python
23+
import sentry_sdk
24+
from sentry_sdk.integrations.feature_flags import FeatureFlagsIntegration
25+
26+
sentry_sdk.init(
27+
dsn="___PUBLIC_DSN___",
28+
integrations=[
29+
FeatureFlagsIntegration(),
30+
],
31+
)
32+
```
33+
34+
## Verify
35+
36+
The integration is tested by calling the `add_feature_flag` API before capturing an exception.
37+
38+
```python
39+
import sentry_sdk
40+
from sentry_sdk.integrations.feature_flags import add_feature_flag
41+
42+
add_feature_flag('test-flag', False)
43+
44+
sentry_sdk.capture_exception(Exception("Something went wrong!"))
45+
```
46+
47+
Go to your Sentry project and confirm that your error event has recorded the feature flag "test-flag" and its value "false".
48+
49+
<PlatformContent includePath="feature-flags/next-steps" />
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: Unleash
3+
description: "Learn how to use Sentry with Unleash."
4+
---
5+
6+
<PlatformContent includePath="feature-flags/prerelease-alert" />
7+
8+
The [Unleash](https://www.getunleash.io/) integration tracks feature flag evaluations produced by the Unleash SDK. These evaluations are held in memory and sent to Sentry for review and analysis if an error occurs. **At the moment, we only support boolean flag evaluations.**
9+
10+
## Install
11+
12+
Install `sentry-sdk` (>=2.19.3) and `UnleashClient` (>=6.0.1) from PyPI.
13+
14+
```bash
15+
pip install --upgrade sentry-sdk UnleashClient
16+
```
17+
18+
## Configure
19+
20+
Add `UnleashIntegration` to your `integrations` list:
21+
22+
```python
23+
import sentry_sdk
24+
from sentry_sdk.integrations.unleash import UnleashIntegration
25+
26+
sentry_sdk.init(
27+
dsn="___PUBLIC_DSN___",
28+
integrations=[UnleashIntegration()],
29+
)
30+
```
31+
32+
For more information on how to use Unleash, read Unleash's [Python reference](https://docs.getunleash.io/reference/sdks/python) and [quickstart guide](https://docs.getunleash.io/quickstart).
33+
34+
## Verify
35+
36+
Test the integration by evaluating a feature flag using your Unleash SDK before capturing an exception.
37+
38+
```python {tabTitle: Python, using is_enabled}
39+
import sentry_sdk
40+
from UnleashClient import UnleashClient
41+
42+
unleash_client = UnleashClient(...) # See Unleash quickstart.
43+
test_flag_enabled = unleash_client.is_enabled("test-flag")
44+
45+
sentry_sdk.capture_exception(Exception("Something went wrong!"))
46+
```
47+
48+
```python {tabTitle: Python, using get_variant}
49+
import sentry_sdk
50+
from UnleashClient import UnleashClient
51+
52+
unleash_client = UnleashClient(...) # See Unleash quickstart.
53+
test_flag_variant = unleash_client.get_variant("test-flag")
54+
test_flag_enabled = test_flag_variant["enabled"]
55+
56+
sentry_sdk.capture_exception(Exception("Something went wrong!"))
57+
```
58+
59+
Visit the [Sentry website](https://sentry.io/issues/) and confirm that your error
60+
event has recorded the feature flag "test-flag", and its value is equal to `test_flag_enabled`.
61+
62+
<PlatformContent includePath="feature-flags/next-steps" />

0 commit comments

Comments
 (0)