Skip to content

Commit e5ccafe

Browse files
cmanallencoolguyzoneantonpirker
authored
feat(flags): Add OpenFeature and LaunchDarkly integration documentation (#11675)
Adds OpenFeature and LaunchDarkly integration documentation. --------- Co-authored-by: Alex Krawiec <[email protected]> Co-authored-by: Anton Pirker <[email protected]>
1 parent c0afb0c commit e5ccafe

File tree

7 files changed

+116
-0
lines changed

7 files changed

+116
-0
lines changed

docs/platforms/python/integrations/index.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ The Sentry SDK uses integrations to hook into the functionality of popular libra
5959
| <LinkWithPlatformIcon platform="python.rq" label="RQ" url="/platforms/python/integrations/rq" /> ||
6060
| <LinkWithPlatformIcon platform="python.ray" label="Ray" url="/platforms/python/integrations/ray" /> | |
6161

62+
## Feature Flags
63+
64+
| | **Auto-enabled** |
65+
| ----------------------------------------------------------------------------------------------------------------------- | :--------------: |
66+
| <LinkWithPlatformIcon platform="launchdarkly" label="LaunchDarkly" url="/platforms/python/integrations/launchdarkly" /> | |
67+
| <LinkWithPlatformIcon platform="openfeature" label="OpenFeature" url="/platforms/python/integrations/openfeature" /> | |
68+
6269
### Cloud Computing
6370

6471
| | **Auto-enabled** |
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: LaunchDarkly
3+
description: "Learn about the LaunchDarkly integration and how to add it to your integrations list."
4+
---
5+
6+
The [LaunchDarkly](https://launchdarkly.com/) integration tracks feature flag evaluations produced by the LaunchDarkly SDK. These evaluations are held in memory and, in the event an error occurs, sent to Sentry for review and analysis.
7+
8+
## Install
9+
10+
Install `sentry-sdk` from PyPI.
11+
12+
```bash
13+
pip install --upgrade 'sentry-sdk'
14+
```
15+
16+
## Configure
17+
18+
Add `LaunchDarklyIntegration()` to your `integrations` list:
19+
20+
```python
21+
import sentry_sdk
22+
from sentry_sdk.integrations.launchdarkly import LaunchDarklyIntegration
23+
24+
sentry_sdk.init(
25+
dsn="___PUBLIC_DSN___",
26+
integrations=[
27+
LaunchDarklyIntegration(),
28+
],
29+
)
30+
```
31+
32+
## Verify
33+
34+
The integration is tested by evaluating a feature flag using your LaunchDarkly SDK before capturing an exception.
35+
36+
```python
37+
import ldclient
38+
import sentry_sdk
39+
40+
client = ldclient.get()
41+
client.variation("hello", Context.create("test-context"), False)
42+
43+
sentry_sdk.capture_exception(Exception("Something went wrong!"))
44+
```
45+
46+
Visit the Sentry website and confirm that your error event has recorded the feature flag "hello" and its value "false".
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: OpenFeature
3+
description: "Learn about the OpenFeature integration and how to add it to your integrations list."
4+
---
5+
6+
The [OpenFeature](https://openfeature.dev/) integration tracks feature flag evaluations produced by the OpenFeature SDK. These evaluations are held in memory and, in the event an error occurs, sent to Sentry for review and analysis.
7+
8+
## Install
9+
10+
Install `sentry-sdk` from PyPI.
11+
12+
```bash
13+
pip install --upgrade 'sentry-sdk'
14+
```
15+
16+
## Configure
17+
18+
Add `OpenFeatureIntegration()` to your `integrations` list:
19+
20+
```python
21+
import sentry_sdk
22+
from sentry_sdk.integrations.OpenFeature import OpenFeatureIntegration
23+
24+
sentry_sdk.init(
25+
dsn="___PUBLIC_DSN___",
26+
integrations=[
27+
OpenFeatureIntegration(),
28+
],
29+
)
30+
```
31+
32+
## Verify
33+
34+
The integration is tested by evaluating a feature flag using your OpenFeature SDK before capturing an exception.
35+
36+
```python
37+
from openfeature import api
38+
import sentry_sdk
39+
40+
client = api.get_client()
41+
client.get_boolean_value("hello", default_value=False)
42+
43+
sentry_sdk.capture_exception(Exception("Something went wrong!"))
44+
```
45+
46+
Visit the Sentry website and confirm that your error event has recorded the feature flag "hello" and its value "false".
58 KB
Loading
20.8 KB
Loading
51.8 KB
Loading

docs/product/issues/issue-details/index.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,23 @@ If you’ve enabled [Session Replay](/product/explore/session-replay/), you’ll
102102

103103
![Session Replay](./img/issue-replay.png)
104104

105+
## Feature Flags
106+
If you’ve enabled a feature flag integration you’ll have access to the feature flag table (if any are associated with the event). The table displays the list of flags and their evaluation result prior to encountering an error.
107+
108+
![Feature Flags](./img/feature-flags.png)
109+
110+
A timeline of suspect flags is also available if you're using one of our support service providers. A Sentry web hook can be registered with the following providers:
111+
112+
- LaunchDarkly
113+
114+
To enable the suspect flags timeline please visit this page. TODO!
115+
116+
![Feature Flags](./img/suspect-flags-timeline.png)
117+
118+
Suspect flags are displayed in the table with a yellow highlight.
119+
120+
![Feature Flags](./img/suspect-flags-table.png)
121+
105122
## Breadcrumbs
106123

107124
![Breadcrumbs](./img/issue-breadcrumbs.png)

0 commit comments

Comments
 (0)