Skip to content
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions docs/organization/integrations/feature-flag/flagsmith/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Flagsmith
sidebar_order: 2
description: Learn about Sentry's Flagsmith integrations.
---

## Evaluation Tracking

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).

### Set Up Evaluation Tracking

To set up evaluation tracking, visit one of our supported languages pages:
* [JavaScript](/platforms/javascript/configuration/integrations/flagsmith/)
* [Python](/platforms/python/integrations/feature-flags/flagsmith/)
Comment thread
emyller marked this conversation as resolved.
Outdated

## Change Tracking

Sentry can track changes to feature flag definitions and report suspicious feature flag edits.

### Set Up Change Tracking

Enabling Change Tracking is a three-step process. To get started, visit the [feature flags settings page](https://sentry.io/orgredirect/organizations/:orgslug/settings/feature-flags/change-tracking/) in a new tab. Then follow the steps listed below.

1. **Click the "Add New Provider" button.**
- One webhook secret can be registered per provider type.
- Select Generic in the dropdown that says "Select a provider".
2. **Register the webhook URL**.
![Flagsmith Sentry Webhook Modal](./img/flagsmith-sentry-webhook-modal.png)
- Go to your Flagsmith project dashboard and navigate to the `/project/:projectid/integrations` page, which can be found by clicking "Integrations" on the top navigation bar.
- Find the Sentry option, and click "Add Integration", which will open a modal.
- Select the Environment from which flag change events will trigger.
- Copy the provided Sentry webhook URL and paste it into "Webhook URL" in the Flagsmith "Sentry Integration" modal.
Comment thread
aliu39 marked this conversation as resolved.
Outdated
3. **Set the Signing Secret**.
- Still in the Flagsmith "Sentry Integration" modal, type in any string between 10 and 60 characters to use as your authorization token ("secret").
Comment thread
aliu39 marked this conversation as resolved.
- Copy the authorization token from the previous step and paste it into the input box next to "Secret" in Sentry settings.

Once saved, Sentry will now accept and authenticate all inbound hooks to your organization's feature flag webhook endpoint.
1 change: 1 addition & 0 deletions docs/organization/integrations/feature-flag/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: "Learn more about Sentry's feature flag integrations."
---

- [Generic](/organization/integrations/feature-flag/generic/)
- [Flagsmith](/organization/integrations/feature-flag/flagsmith/)
- [LaunchDarkly](/organization/integrations/feature-flag/launchdarkly/)
- [Statsig](/organization/integrations/feature-flag/statsig/)
- [Split](/organization/integrations/feature-flag/split/)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: LaunchDarkly
sidebar_order: 2
sidebar_order: 3
description: Learn about Sentry's LaunchDarkly integrations.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Split
sidebar_order: 4
sidebar_order: 5
description: "Learn more about Sentry's Split integration, which allows you to use Sentry data in your Split analyses."
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Statsig
sidebar_order: 3
sidebar_order: 4
description: Learn about Sentry's Statsig integrations.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Unleash
sidebar_order: 5
sidebar_order: 6
description: Learn about Sentry's Unleash integrations.
---

Expand Down
Copy link
Copy Markdown
Member

@aliu39 aliu39 Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For platform docs, I believe it's not our convention to add pages under integrations/ if there's no integration exported from Sentry. Since we're using openfeature and setup code is the same, I think we could mention the Flagsmith provider and how to import and initialize it, under a section of /integrations/openfeature.mdx under "Evaluation Tracking"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whipping up a draft of what I think could work.. I'll link it here when done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend using this to update the eval tracking section for the organization/integrations/ page, and reverting the changes under docs/platforms/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if this way of suggesting changes was a little janky 😬 I needed a way to see things on my local dev mode, so I checked out sentry's master branch. Thanks again for adding these docs!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch! I've applied it with a few edits:

  • Kept the screenshot. As per this comment, let me know if it was also intentional.
  • Fixed a couple typos.

Also reverted all changes from docs/platforms/ and platform-includes/ — I assume the latter is no longer needed, although this change connects to:

(...) I think we could mention the Flagsmith provider and how to import and initialize it, under a section of /integrations/openfeature.mdx.

Ideally, we'd love to see Sentry shipping with Flagsmith integrations and proper documentation. I'm not sure adding a Flagsmith section to the OpenFeature documentation is the right architecture but I'm good with it as a first iteration. We'll coordinate that. 😉

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup edits look good!

Ideally, we'd love to see Sentry shipping with Flagsmith integrations and proper documentation. I'm not sure adding a Flagsmith section to the OpenFeature documentation is the right architecture but I'm good with it as a first iteration. We'll coordinate that. 😉

Sounds good - if Sentry integrates directly with flagsmith SDKs in the future, we can add to platform docs. Before that I think it's best to link to Openfeature from flagsmith, with the /organizations/ page serving as the integration home page (both eval and change tracking). The other providers follow a similar pattern.

Copy link
Copy Markdown
Contributor Author

@emyller emyller Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find the best place in Sentry docs under /organizations/ to add an instrumentation example for Evaluation Tracking. Instead, I've opened a pull request to our own docs with some important bits regarding OpenFeature. Feel free to help us validate it!

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Flagsmith
description: "Learn how to use Sentry with Flagsmith."
notSupported:
- javascript.aws-lambda
- javascript.azure-functions
- javascript.bun
- javascript.capacitor
- javascript.cloudflare
- javascript.connect
- javascript.cordova
- javascript.deno
- javascript.electron
- javascript.express
- javascript.fastify
- javascript.gcp-functions
- javascript.hapi
- javascript.hono
- javascript.koa
- javascript.nestjs
- javascript.node
- javascript.wasm
- javascript.tanstackstart-react
---

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

<Alert>

This integration only works inside a browser environment. It is only available from a package-based install (e.g. `npm` or `yarn`).

</Alert>

[Flagsmith](https://flagsmith.com/) relies on the [OpenFeature](https://openfeature.dev/) integration to track 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 Sentry SDK **versions 8.43.0 or higher.**

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

<PlatformContent includePath="/configuration/flagsmith" />

Visit the Sentry website and confirm that your error event has recorded the feature flag "test-flag" and its value "false".

<PlatformContent includePath="feature-flags/next-steps" />
1 change: 1 addition & 0 deletions docs/platforms/python/feature-flags/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ description: With Feature Flags, Sentry tracks feature flag evaluations in your

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.

- [Flagsmith](/platforms/python/integrations/flagsmith/)
- [LaunchDarkly](/platforms/python/integrations/launchdarkly/)
- [OpenFeature](/platforms/python/integrations/openfeature/)
- [Statsig](/platforms/python/integrations/statsig/)
Expand Down
75 changes: 75 additions & 0 deletions docs/platforms/python/integrations/flagsmith/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: Flagsmith
description: "Learn how to use Sentry with Flagsmith."
---

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

[Flagsmith](https://flagsmith.com/) relies on the [OpenFeature](https://openfeature.dev/) integration to track 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.**

## Install

Install `sentry-sdk` from PyPI with the `openfeature` extra.

```bash {tabTitle:pip}
pip install "sentry-sdk[openfeature]" openfeature-provider-flagsmith
```
```bash {tabTitle:uv}
uv add "sentry-sdk[openfeature]" openfeature-provider-flagsmith
```

## Configure

Set `FlagsmithProvider()` as the provider for the OpenFeature client, then add `OpenFeatureIntegration()` to your `integrations` list:

```python
import flagsmith
import sentry_sdk
from openfeature import api
from openfeature_flagsmith.provider import FlagsmithProvider
from sentry_sdk.integrations.openfeature import OpenFeatureIntegration

flagsmith_client = flagsmith.Flagsmith(
environment_key='<Flagsmith public environment key>',
)

flagsmith_provider = FlagsmithProvider(
client=flagsmith_client,
)

api.set_provider(flagsmith_provider)

sentry_sdk.init(
dsn="___PUBLIC_DSN___",
# Add data like request headers and IP for users, if applicable;
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,
integrations=[
OpenFeatureIntegration(),
],
)
```

## Verify

The integration is tested by evaluating a feature flag using your OpenFeature SDK before capturing an exception.

```python
from openfeature import api
import sentry_sdk

client = api.get_client()
client.get_boolean_value("hello", default_value=False)

sentry_sdk.capture_exception(Exception("Something went wrong!"))
```

Visit the Sentry website and confirm that your error event has recorded the feature flag "hello" and its value "false".

## Supported Versions

- openfeature-sdk >= 0.7.1
- sentry-sdk >= 2.19.2
- python >= 3.9

<PlatformContent includePath="feature-flags/next-steps" />
45 changes: 45 additions & 0 deletions platform-includes/configuration/flagsmith/javascript.angular.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Before using this integration, you need to install and instrument both the [OpenFeature SDK](https://www.npmjs.com/package/@openfeature/web-sdk) and the [OpenFeature Flagsmith provider](https://www.npmjs.com/package/@openfeature/flagsmith-client-provider) in your app. Learn more by reading OpenFeature's [SDK docs](https://openfeature.dev/docs/reference/technologies/client/web/) and [provider docs](https://openfeature.dev/docs/reference/concepts/provider).

```javascript {tabTitle: JavaScript (Track All Evals)}
import * as Sentry from '@sentry/angular';
import { FlagsmithClientProvider } from '@openfeature/flagsmith-client-provider';
import { OpenFeature } from '@openfeature/web-sdk';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.openFeatureIntegration()]
});

const flagsmithClientProvider = new FlagsmithClientProvider({
environmentID: '<ENVIRONMENT_ID>'
});
OpenFeature.setProvider(flagsmithClientProvider);

OpenFeature.addHooks(new Sentry.OpenFeatureIntegrationHook());

const client = OpenFeature.getClient();
const result = client.getBooleanValue('test-flag', false); // evaluate with a default value
Sentry.captureException(new Error('Something went wrong!'));
```

```javascript {tabTitle: JavaScript (Track One Client)}
import * as Sentry from '@sentry/angular';
import { FlagsmithClientProvider } from '@openfeature/flagsmith-client-provider';
import { OpenFeature } from '@openfeature/web-sdk';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.openFeatureIntegration()]
});

const flagsmithClientProvider = new FlagsmithClientProvider({
environmentID: '<ENVIRONMENT_ID>'
});
OpenFeature.setProvider(flagsmithClientProvider);

const client = OpenFeature.getClient();
client.addHooks(new Sentry.OpenFeatureIntegrationHook());

const result = client.getBooleanValue('test-flag', false); // evaluate with a default value
Sentry.captureException(new Error('Something went wrong!'));
```
45 changes: 45 additions & 0 deletions platform-includes/configuration/flagsmith/javascript.astro.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Before using this integration, you need to install and instrument both the [OpenFeature SDK](https://www.npmjs.com/package/@openfeature/web-sdk) and the [OpenFeature Flagsmith provider](https://www.npmjs.com/package/@openfeature/flagsmith-client-provider) in your app. Learn more by reading OpenFeature's [SDK docs](https://openfeature.dev/docs/reference/technologies/client/web/) and [provider docs](https://openfeature.dev/docs/reference/concepts/provider).

```javascript {tabTitle: JavaScript (Track All Evals)}
import * as Sentry from '@sentry/astro';
import { FlagsmithClientProvider } from '@openfeature/flagsmith-client-provider';
import { OpenFeature } from '@openfeature/web-sdk';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.openFeatureIntegration()]
});

const flagsmithClientProvider = new FlagsmithClientProvider({
environmentID: '<ENVIRONMENT_ID>'
});
OpenFeature.setProvider(flagsmithClientProvider);

OpenFeature.addHooks(new Sentry.OpenFeatureIntegrationHook());

const client = OpenFeature.getClient();
const result = client.getBooleanValue('test-flag', false); // evaluate with a default value
Sentry.captureException(new Error('Something went wrong!'));
```

```javascript {tabTitle: JavaScript (Track One Client)}
import * as Sentry from '@sentry/astro';
import { FlagsmithClientProvider } from '@openfeature/flagsmith-client-provider';
import { OpenFeature } from '@openfeature/web-sdk';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.openFeatureIntegration()]
});

const flagsmithClientProvider = new FlagsmithClientProvider({
environmentID: '<ENVIRONMENT_ID>'
});
OpenFeature.setProvider(flagsmithClientProvider);

const client = OpenFeature.getClient();
client.addHooks(new Sentry.OpenFeatureIntegrationHook());

const result = client.getBooleanValue('test-flag', false); // evaluate with a default value
Sentry.captureException(new Error('Something went wrong!'));
```
45 changes: 45 additions & 0 deletions platform-includes/configuration/flagsmith/javascript.ember.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Before using this integration, you need to install and instrument both the [OpenFeature SDK](https://www.npmjs.com/package/@openfeature/web-sdk) and the [OpenFeature Flagsmith provider](https://www.npmjs.com/package/@openfeature/flagsmith-client-provider) in your app. Learn more by reading OpenFeature's [SDK docs](https://openfeature.dev/docs/reference/technologies/client/web/) and [provider docs](https://openfeature.dev/docs/reference/concepts/provider).

```javascript {tabTitle: JavaScript (Track All Evals)}
import * as Sentry from '@sentry/ember';
import { FlagsmithClientProvider } from '@openfeature/flagsmith-client-provider';
import { OpenFeature } from '@openfeature/web-sdk';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.openFeatureIntegration()]
});

const flagsmithClientProvider = new FlagsmithClientProvider({
environmentID: '<ENVIRONMENT_ID>'
});
OpenFeature.setProvider(flagsmithClientProvider);

OpenFeature.addHooks(new Sentry.OpenFeatureIntegrationHook());

const client = OpenFeature.getClient();
const result = client.getBooleanValue('test-flag', false); // evaluate with a default value
Sentry.captureException(new Error('Something went wrong!'));
```

```javascript {tabTitle: JavaScript (Track One Client)}
import * as Sentry from '@sentry/ember';
import { FlagsmithClientProvider } from '@openfeature/flagsmith-client-provider';
import { OpenFeature } from '@openfeature/web-sdk';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.openFeatureIntegration()]
});

const flagsmithClientProvider = new FlagsmithClientProvider({
environmentID: '<ENVIRONMENT_ID>'
});
OpenFeature.setProvider(flagsmithClientProvider);

const client = OpenFeature.getClient();
client.addHooks(new Sentry.OpenFeatureIntegrationHook());

const result = client.getBooleanValue('test-flag', false); // evaluate with a default value
Sentry.captureException(new Error('Something went wrong!'));
```
45 changes: 45 additions & 0 deletions platform-includes/configuration/flagsmith/javascript.gatsby.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Before using this integration, you need to install and instrument both the [OpenFeature SDK](https://www.npmjs.com/package/@openfeature/web-sdk) and the [OpenFeature Flagsmith provider](https://www.npmjs.com/package/@openfeature/flagsmith-client-provider) in your app. Learn more by reading OpenFeature's [SDK docs](https://openfeature.dev/docs/reference/technologies/client/web/) and [provider docs](https://openfeature.dev/docs/reference/concepts/provider).

```javascript {tabTitle: JavaScript (Track All Evals)}
import * as Sentry from '@sentry/gatsby';
import { FlagsmithClientProvider } from '@openfeature/flagsmith-client-provider';
import { OpenFeature } from '@openfeature/web-sdk';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.openFeatureIntegration()]
});

const flagsmithClientProvider = new FlagsmithClientProvider({
environmentID: '<ENVIRONMENT_ID>'
});
OpenFeature.setProvider(flagsmithClientProvider);

OpenFeature.addHooks(new Sentry.OpenFeatureIntegrationHook());

const client = OpenFeature.getClient();
const result = client.getBooleanValue('test-flag', false); // evaluate with a default value
Sentry.captureException(new Error('Something went wrong!'));
```

```javascript {tabTitle: JavaScript (Track One Client)}
import * as Sentry from '@sentry/gatsby';
import { FlagsmithClientProvider } from '@openfeature/flagsmith-client-provider';
import { OpenFeature } from '@openfeature/web-sdk';

Sentry.init({
dsn: '___PUBLIC_DSN___',
integrations: [Sentry.openFeatureIntegration()]
});

const flagsmithClientProvider = new FlagsmithClientProvider({
environmentID: '<ENVIRONMENT_ID>'
});
OpenFeature.setProvider(flagsmithClientProvider);

const client = OpenFeature.getClient();
client.addHooks(new Sentry.OpenFeatureIntegrationHook());

const result = client.getBooleanValue('test-flag', false); // evaluate with a default value
Sentry.captureException(new Error('Something went wrong!'));
```
Loading
Loading