diff --git a/docs/platforms/python/feature-flags/index.mdx b/docs/platforms/python/feature-flags/index.mdx index 94e8c7372d952..696e28ea95cbc 100644 --- a/docs/platforms/python/feature-flags/index.mdx +++ b/docs/platforms/python/feature-flags/index.mdx @@ -16,5 +16,6 @@ Evaluation tracking requires enabling an SDK integration. Integrations are provi - [OpenFeature](/platforms/python/integrations/openfeature/) - [LaunchDarkly](/platforms/python/integrations/launchdarkly/) +- [Manual Tracking](/platforms/python/integrations/feature_flags/) - if you use an unsupported or in-house provider, you may track evaluations through an API. diff --git a/docs/platforms/python/integrations/feature_flags/index.mdx b/docs/platforms/python/integrations/feature_flags/index.mdx new file mode 100644 index 0000000000000..0cd415fa358dc --- /dev/null +++ b/docs/platforms/python/integrations/feature_flags/index.mdx @@ -0,0 +1,50 @@ +--- +title: Feature Flags +description: "Learn how to attach custom feature flag data to Sentry error events." +--- + + + +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. +**At the moment, we only support boolean flag evaluations.** + +## Install + +Install `sentry-sdk` (>=TODO:) from PyPI. + +```bash +pip install --upgrade 'sentry-sdk' +``` + +## Configure + +Add `FeatureFlagsIntegration()` to your `integrations` list: + +```python +import sentry_sdk +from sentry_sdk.integrations.feature_flags import FeatureFlagsIntegration + +sentry_sdk.init( + dsn="___PUBLIC_DSN___", + integrations=[ + FeatureFlagsIntegration(), + ], +) +``` + +## Verify + +The integration is tested by calling the `add_feature_flag` API before capturing an exception. + +```python +import sentry_sdk +from sentry_sdk.integrations.feature_flags import add_feature_flag + +add_feature_flag('test-flag', False) + +sentry_sdk.capture_exception(Exception("Something went wrong!")) +``` + +Visit the Sentry website and confirm that your error event has recorded the feature flag "test-flag" and its value "false". + + diff --git a/docs/platforms/python/integrations/index.mdx b/docs/platforms/python/integrations/index.mdx index 076d473ef1dc6..717ffd41bf2ed 100644 --- a/docs/platforms/python/integrations/index.mdx +++ b/docs/platforms/python/integrations/index.mdx @@ -65,6 +65,7 @@ The Sentry SDK uses integrations to hook into the functionality of popular libra | ----------------------------------------------------------------------------------------------------------------------- | :--------------: | | | | | | | +| | | ### Cloud Computing