Skip to content

Commit 8050c4b

Browse files
authored
feat(flags): show ff index and generic integration doc for serverside JS (#14328)
In [9.31.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.31.0) JS SDK we started supporting `featureFlagsIntegration` in node. This PR shows the FF index page in node platforms with only this integration linked: <img width="1013" height="966" alt="Screenshot 2025-07-10 at 4 26 26 PM" src="https://github.com/user-attachments/assets/c9420892-d5af-451f-a8cc-7f3515990141" /> And shows the `featureFlagsIntegration` page for node platforms, with 9.31.0 as the min version. Deno (server): <img width="692" height="1165" alt="Screenshot 2025-07-10 at 4 46 35 PM" src="https://github.com/user-attachments/assets/390e5c30-58e5-46ef-973f-15b73d8d1825" /> React (browser): <img width="707" height="1070" alt="Screenshot 2025-07-10 at 4 45 21 PM" src="https://github.com/user-attachments/assets/ef12a5e7-76eb-47e5-b75b-07562f57ebae" />
1 parent 5a7123d commit 8050c4b

File tree

71 files changed

+508
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+508
-107
lines changed

docs/platforms/dart/common/feature-flags/index.mdx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,4 @@ description: With Feature Flags, Sentry tracks feature flag evaluations in your
1010

1111
## Enable Evaluation Tracking
1212

13-
If you use a third-party SDK to evaluate feature flags, you can enable Sentry to track those evaluations. Integrations are provider specific, and documentation for supported SDKs is listed below:
14-
15-
- [Firebase Remote Config](/platforms/dart/configuration/integrations/firebase-remote-config/)
16-
17-
### Manual Usage
18-
19-
Call `Sentry.addFeatureFlag` to track feature flag evaluations:
20-
21-
```dart
22-
Sentry.addFeatureFlag("feature_flag_a", true);
23-
```
24-
25-
Calling this function multiple times with the same flag name will override the previous value.
13+
<PlatformContent includePath="feature-flags/evaluation-tracking-index" />

docs/platforms/javascript/common/configuration/integrations/featureflags.mdx

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,13 @@
11
---
22
title: Generic Feature Flags Integration
33
description: "Learn how to attach custom feature flag data to Sentry error events."
4-
notSupported:
5-
- javascript.aws-lambda
6-
- javascript.azure-functions
7-
- javascript.bun
8-
- javascript.capacitor
9-
- javascript.cloudflare
10-
- javascript.connect
11-
- javascript.cordova
12-
- javascript.deno
13-
- javascript.electron
14-
- javascript.express
15-
- javascript.fastify
16-
- javascript.gcp-functions
17-
- javascript.hapi
18-
- javascript.hono
19-
- javascript.koa
20-
- javascript.nestjs
21-
- javascript.node
22-
- javascript.wasm
234
---
245

25-
<Alert>
26-
27-
This integration only works inside a browser environment. It is only available from a package-based install (e.g. `npm` or `yarn`).
28-
29-
</Alert>
30-
31-
<Alert level ="info">
32-
33-
If you are using an external feature flag provider, refer to the [supported list](/platforms/javascript/feature-flags/#enable-evaluation-tracking) before setting up this integration.
34-
35-
</Alert>
36-
376
The Feature Flags integration allows you to manually track feature flag evaluations through an API.
387
These evaluations are held in memory and sent to Sentry on error and transaction events.
39-
**At the moment, we only support boolean flag evaluations.** This integration is available in
40-
Sentry SDK **versions 8.43.0 or higher.**
8+
**At the moment, we only support boolean flag evaluations.**
9+
10+
<PlatformContent includePath="feature-flags/integrations/js-featureflags/min-version" />
4111

4212
_Import names: `Sentry.featureFlagsIntegration` and `type Sentry.FeatureFlagsIntegration`_
4313

docs/platforms/javascript/common/configuration/integrations/openfeature.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ notSupported:
2020
- javascript.nestjs
2121
- javascript.node
2222
- javascript.wasm
23-
- javascript.tanstackstart-react
2423
---
2524

2625
<Alert>

docs/platforms/javascript/common/feature-flags/index.mdx

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,6 @@
22
title: Set Up Feature Flags
33
sidebar_title: Feature Flags
44
sidebar_order: 7000
5-
notSupported:
6-
- javascript.aws-lambda
7-
- javascript.azure-functions
8-
- javascript.bun
9-
- javascript.capacitor
10-
- javascript.cloudflare
11-
- javascript.connect
12-
- javascript.cordova
13-
- javascript.deno
14-
- javascript.electron
15-
- javascript.express
16-
- javascript.fastify
17-
- javascript.gcp-functions
18-
- javascript.hapi
19-
- javascript.hono
20-
- javascript.koa
21-
- javascript.nestjs
22-
- javascript.node
23-
- javascript.wasm
245
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.
256
---
267

@@ -30,17 +11,8 @@ description: With Feature Flags, Sentry tracks feature flag evaluations in your
3011

3112
## Enable Evaluation Tracking
3213

33-
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.
34-
35-
- [LaunchDarkly](/platforms/javascript/configuration/integrations/launchdarkly/)
36-
- [OpenFeature](/platforms/javascript/configuration/integrations/openfeature/) (multiple providers supported)
37-
- [Statsig](/platforms/javascript/configuration/integrations/statsig/)
38-
- [Unleash](/platforms/javascript/configuration/integrations/unleash/)
39-
40-
### Generic Integration
41-
42-
The generic `featureFlagsIntegration` allows you to manually track feature flag evaluations. Read the [documentation](/platforms/javascript/configuration/integrations/featureflags/) to learn more.
14+
<PlatformContent includePath="feature-flags/evaluation-tracking-index" />
4315

4416
## Enable Change Tracking
4517

46-
<PlatformContent includePath="feature-flags/change-tracking-list" />
18+
<PlatformContent includePath="feature-flags/change-tracking-index" />

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

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,8 @@ description: With Feature Flags, Sentry tracks feature flag evaluations in your
1111

1212
## Enable Evaluation Tracking
1313

14-
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.
15-
16-
- [LaunchDarkly](/platforms/python/integrations/launchdarkly/)
17-
- [OpenFeature](/platforms/python/integrations/openfeature/) (multiple providers supported)
18-
- [Statsig](/platforms/python/integrations/statsig/)
19-
- [Unleash](/platforms/python/integrations/unleash/)
20-
21-
### Generic API
22-
If you use an unsupported solution, you can use the generic API to manually track feature flag evaluations. These evaluations are held in memory and are sent to Sentry on error and transaction events. **At the moment, we only support boolean flag evaluations.**
23-
24-
```python
25-
import sentry_sdk
26-
from sentry_sdk.feature_flags import add_feature_flag
27-
28-
add_feature_flag('test-flag', False) # Records an evaluation and its result.
29-
30-
sentry_sdk.capture_exception(Exception("Something went wrong!"))
31-
```
32-
33-
Go to your Sentry project and confirm that your error event has recorded the feature flag "test-flag" and its value "false".
14+
<PlatformContent includePath="feature-flags/evaluation-tracking-index" />
3415

3516
## Enable Change Tracking
3617

37-
<PlatformContent includePath="feature-flags/change-tracking-list" />
18+
<PlatformContent includePath="feature-flags/change-tracking-index" />

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ Feature flag change tracking and feature flag evaluation tracking is currently i
1010

1111
</Alert>
1212

13-
Enabling a feature flag integration provides deep insights into the state of your application prior to an error. A list of flags and their evaluation results are displayed on each error event in the order of evaluation.
13+
Enabling a feature flag integration provides deep insights into the state of your application prior to an error. A list of flags and their evaluation results are displayed on each error event in the order of evaluation.
1414

1515
Integrating Sentry with your feature flag provider enables Sentry to correlate feature flag changes with new error events and mark certain changes as suspicious.
1616

1717
## Evaluation Tracking
1818

19-
Flag evaluations will appear in the "Feature Flag" section of Issue Details page as a table, with "suspect" flag predictions highlighted in yellow.
19+
Flag evaluations will appear in the "Feature Flag" section of Issue Details page as a table, with "suspect" flag predictions highlighted in yellow.
2020

2121
![Flag Change Suspect](./img/SuspectFlag.png)
2222

2323
For each event, we track the 100 most recently evaluated flags leading up to the error. 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).
2424

25-
Setting up evaluation tracking also allows you to use Issues Search in conjunction with feature flags. On Issues Search, using the `flags` keyword will allow you to filter for issues containing errors where the feature flag evaluated value is true or false.
25+
Setting up evaluation tracking also allows you to use Issues Search in conjunction with feature flags. On Issues Search, using the `flags` keyword will allow you to filter for issues containing errors where the feature flag evaluated value is true or false.
2626

2727
![Flag Change Search](./img/FlagsSearch.png)
2828

@@ -44,20 +44,20 @@ This view is useful for diagnosing the impacted audience of feature flag changes
4444

4545
## Change Tracking
4646

47-
Change tracking enables Sentry to listen for additions, removals, and modifications to your feature flags. On change, we'll record the change event in the audit log.
47+
Change tracking enables Sentry to listen for additions, removals, and modifications to your feature flags. On change, we'll record the change event in the audit log.
4848

4949
![Flag Change Tracking](./img/FlagChangeTracking.png)
5050

51-
Within an issue, the audit log is represented in the "event" chart and presents itself as a "release" line.
51+
Within an issue, the audit log is represented in the "event" chart and presents itself as a "release" line.
5252

5353
![Flag Change Issue](./img/FlagChangeIssue.png)
5454

55-
If the change is responsible for a new error event, we'll notify you by marking the feature flag as "suspect" on the Issue Details page.
55+
If the change is responsible for a new error event, we'll notify you by marking the feature flag as "suspect" on the Issue Details page.
5656

5757
![Flag Change Suspect](./img/SuspectFlag.png)
5858

5959
Learn more about how to interact with feature flag insights within the Sentry UI by reading the [Issue Details documentation](/product/issues/issue-details/#feature-flags).
6060

6161
### Set Up Change Tracking
6262

63-
<PlatformContent includePath="feature-flags/change-tracking-list" platform="_default"/>
63+
<PlatformContent includePath="feature-flags/change-tracking-index" platform="_default"/>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
```typescript
2+
import * as Sentry from '@sentry/aws-lambda';
3+
4+
Sentry.init({
5+
dsn: '___PUBLIC_DSN___',
6+
integrations: [Sentry.featureFlagsIntegration()]
7+
});
8+
9+
const flagsIntegration = Sentry.getClient()?.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags');
10+
if (flagsIntegration) {
11+
flagsIntegration.addFeatureFlag('test-flag', false);
12+
} else {
13+
// Something went wrong, check your DSN and/or integrations
14+
}
15+
Sentry.captureException(new Error('Something went wrong!'));
16+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
```typescript
2+
import * as Sentry from '@sentry/azure-functions';
3+
4+
Sentry.init({
5+
dsn: '___PUBLIC_DSN___',
6+
integrations: [Sentry.featureFlagsIntegration()]
7+
});
8+
9+
const flagsIntegration = Sentry.getClient()?.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags');
10+
if (flagsIntegration) {
11+
flagsIntegration.addFeatureFlag('test-flag', false);
12+
} else {
13+
// Something went wrong, check your DSN and/or integrations
14+
}
15+
Sentry.captureException(new Error('Something went wrong!'));
16+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
```typescript
2+
import * as Sentry from '@sentry/bun';
3+
4+
Sentry.init({
5+
dsn: '___PUBLIC_DSN___',
6+
integrations: [Sentry.featureFlagsIntegration()]
7+
});
8+
9+
const flagsIntegration = Sentry.getClient()?.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags');
10+
if (flagsIntegration) {
11+
flagsIntegration.addFeatureFlag('test-flag', false);
12+
} else {
13+
// Something went wrong, check your DSN and/or integrations
14+
}
15+
Sentry.captureException(new Error('Something went wrong!'));
16+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
```typescript
2+
import * as Sentry from '@sentry/capacitor';
3+
4+
Sentry.init({
5+
dsn: '___PUBLIC_DSN___',
6+
integrations: [Sentry.featureFlagsIntegration()]
7+
});
8+
9+
const flagsIntegration = Sentry.getClient()?.getIntegrationByName<Sentry.FeatureFlagsIntegration>('FeatureFlags');
10+
if (flagsIntegration) {
11+
flagsIntegration.addFeatureFlag('test-flag', false);
12+
} else {
13+
// Something went wrong, check your DSN and/or integrations
14+
}
15+
Sentry.captureException(new Error('Something went wrong!'));
16+
```

0 commit comments

Comments
 (0)