Skip to content

Commit 35b338f

Browse files
committed
Add feature flags on spans documentation
1 parent 7a2db7b commit 35b338f

File tree

9 files changed

+13
-11
lines changed

9 files changed

+13
-11
lines changed

develop-docs/sdk/expected-features/index.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,13 @@ This functionality should be gated behind the `includeLocalVariables` option, wh
118118

119119
## Feature Flags
120120

121-
An SDK may optionally support feature flag collection. Feature flags are collected on evaluation, stored on the scope, and submitted to Sentry on error obeying the schema specified in the <Link to="/sdk/data-model/event-payloads/contexts/#feature-flag-context">Feature Flag Context</Link> protocol documentation.
121+
An SDK may optionally track feature flag evaluations. Feature flags can be attached to error events or to span events.
122122

123-
If an SDK supports feature flags it must expose a function `addFeatureFlag` which has similar behavior to the `set_tag` function. It must accept a key of type string and a value which is a union of string, boolean, integer, float, and structure. An SDK may hold up to 100 evaluations (similar to the breadcrumb implementation). Evaluations are ordered based on their evaluation time. Typically, an LRU cache is used to store feature flags. When the capacity of the cache is exceeded the oldest flag is dropped. Any (or multiple) data structure(s) may be chosen by the SDK to store feature flags as long as the evaluation order of the flags is maintained.
123+
When tracking feature flag evaluations on spans, we track the first 10 feature flags evaluated within the span's scope. Evaluations are span attributes and follow the existing span attribute schema.
124124

125-
Because flags are stored on the scope, when a scope forks the flags data structure must be cloned. Failure to clone the data structure appropriately will lead to flags leaking across thread boundaries and lead to unexpected results.
125+
When tracking on error feature flag evaluations, we record the 100 most recent, unique feature flag evaluations. Evaluations are stored on the scope. When the scope forks a copy of the collected feature flag evaluations are given to the child scope. Mutations to the child's copy of the feature flags object should not be propagated to the parent. Flag evaluations within a scope are considered local to the scope and do not propagate. Evaluations should be submitted to Sentry following the schema specified in the <Link to="/sdk/data-model/event-payloads/contexts/#feature-flag-context">Feature Flag Context</Link> protocol documentation.
126+
127+
If an SDK supports feature flags it must expose a function `add_feature_flag` which has similar behavior to the `set_tag` function. It must accept a key of type string and a value which is a union of string, boolean, integer, float, and structure.
126128

127129
### Integrations
128130

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This integration only works inside a browser environment. It is only available f
3030

3131
</Alert>
3232

33-
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. **At the moment, we only support boolean flag evaluations.** This integration is available in
33+
The [LaunchDarkly](https://launchdarkly.com/) integration tracks feature flag evaluations produced by the LaunchDarkly SDK. These evaluations are held in memory and are sent to Sentry on error and trace events. **At the moment, we only support boolean flag evaluations.** This integration is available in
3434
Sentry SDK **versions 8.43.0 or higher.**
3535

3636
_Import names: `Sentry.launchDarklyIntegration` and `Sentry.buildLaunchDarklyFlagUsedHandler`_

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ This integration only works inside a browser environment. It is only available f
3131

3232
</Alert>
3333

34-
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. **At the moment, we only support boolean flag evaluations.** This integration is available in
34+
The [OpenFeature](https://openfeature.dev/) integration tracks feature flag evaluations produced by the OpenFeature SDK. These evaluations are held in memory and are sent to Sentry on error and trace events. **At the moment, we only support boolean flag evaluations.** This integration is available in
3535
Sentry SDK **versions 8.43.0 or higher.**
3636

3737
_Import name: `Sentry.openFeatureIntegration` and `Sentry.OpenFeatureIntegrationHook`_

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This integration only works inside a browser environment. It is only available f
2929

3030
</Alert>
3131

32-
The [Statsig](https://www.statsig.com/) integration tracks feature flag evaluations produced by the Statsig JavaScript Client SDK. These evaluations are held in memory, and in the event an error occurs, sent to Sentry for review and analysis. **At the moment, we only support boolean flag evaluations from Statsig's `checkGate` method**. Learn more about [Statsig feature gates](https://docs.statsig.com/feature-flags/working-with/).
32+
The [Statsig](https://www.statsig.com/) integration tracks feature flag evaluations produced by the Statsig JavaScript Client SDK. These evaluations are held in memory and are sent to Sentry on error and trace events. **At the moment, we only support boolean flag evaluations from Statsig's `checkGate` method**. Learn more about [Statsig feature gates](https://docs.statsig.com/feature-flags/working-with/).
3333

3434
This integration is available in Sentry SDK **versions 9.0.0 and higher**, or **versions 8.55.0 and higher for v8.**
3535

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This integration only works inside a browser environment. It is only available f
3030

3131
</Alert>
3232

33-
The [Unleash](https://www.getunleash.io/) integration tracks feature flag evaluations produced by the Unleash SDK. These evaluations are held in memory, and in the event an error occurs, sent to Sentry for review and analysis. **At the moment, we only support boolean flag evaluations from Unleash's isEnabled method.** This integration is available in Sentry SDK **versions 8.51.0 or higher.**
33+
The [Unleash](https://www.getunleash.io/) integration tracks feature flag evaluations produced by the Unleash SDK. These evaluations are held in memory and are sent to Sentry on error and trace events. **At the moment, we only support boolean flag evaluations from Unleash's isEnabled method.** This integration is available in Sentry SDK **versions 8.51.0 or higher.**
3434

3535
_Import names: `Sentry.unleashIntegration`_
3636

docs/platforms/python/integrations/launchdarkly/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "Learn how to use Sentry with LaunchDarkly."
55

66
<PlatformContent includePath="feature-flags/prerelease-alert" />
77

8-
The [LaunchDarkly](https://launchdarkly.com/) integration tracks feature flag evaluations produced by the LaunchDarkly 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.**
8+
The [LaunchDarkly](https://launchdarkly.com/) integration tracks feature flag evaluations produced by the LaunchDarkly SDK. These evaluations are held in memory and are sent to Sentry on error and trace events. **At the moment, we only support boolean flag evaluations.**
99

1010
## Install
1111

docs/platforms/python/integrations/openfeature/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "Learn how to use Sentry with OpenFeature."
55

66
<PlatformContent includePath="feature-flags/prerelease-alert" />
77

8-
The [OpenFeature](https://openfeature.dev/) integration tracks feature flag evaluations produced by the OpenFeature 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.**
8+
The [OpenFeature](https://openfeature.dev/) integration tracks feature flag evaluations produced by the OpenFeature SDK. These evaluations are held in memory and are sent to Sentry on error and trace events. **At the moment, we only support boolean flag evaluations.**
99

1010
## Install
1111

docs/platforms/python/integrations/statsig/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "Learn how to use Sentry with Statsig."
55

66
<PlatformContent includePath="feature-flags/prerelease-alert" />
77

8-
The [Statsig](https://www.statsig.com/) integration tracks feature flag evaluations produced by the Statsig Python Server 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 from Statsig's `check_gate` function.** Learn more about [Statsig feature gates](https://docs.statsig.com/feature-flags/working-with/).
8+
The [Statsig](https://www.statsig.com/) integration tracks feature flag evaluations produced by the Statsig Python Server SDK. These evaluations are held in memory and are sent to Sentry on error and trace events. **At the moment, we only support boolean flag evaluations from Statsig's `check_gate` function.** Learn more about [Statsig feature gates](https://docs.statsig.com/feature-flags/working-with/).
99

1010
## Install
1111

docs/platforms/python/integrations/unleash/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "Learn how to use Sentry with Unleash."
55

66
<PlatformContent includePath="feature-flags/prerelease-alert" />
77

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 from Unleash's is_enabled method.**
8+
The [Unleash](https://www.getunleash.io/) integration tracks feature flag evaluations produced by the Unleash SDK. These evaluations are held in memory and are sent to Sentry on error and trace events. **At the moment, we only support boolean flag evaluations from Unleash's is_enabled method.**
99

1010
## Install
1111

0 commit comments

Comments
 (0)