diff --git a/docs/platforms/php/common/feature-flags/index.mdx b/docs/platforms/php/common/feature-flags/index.mdx new file mode 100644 index 00000000000000..821c49ff43d5a6 --- /dev/null +++ b/docs/platforms/php/common/feature-flags/index.mdx @@ -0,0 +1,14 @@ +--- +title: Set Up Feature Flags +sidebar_title: Feature Flags +sidebar_order: 7000 +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. +--- + +## Prerequisites + +- [Sentry SDK](/) version `4.18.1` or above. + +## Enable Evaluation Tracking + + diff --git a/platform-includes/feature-flags/evaluation-tracking-index/php.mdx b/platform-includes/feature-flags/evaluation-tracking-index/php.mdx new file mode 100644 index 00000000000000..a39fb9d3d9b919 --- /dev/null +++ b/platform-includes/feature-flags/evaluation-tracking-index/php.mdx @@ -0,0 +1,12 @@ +### Generic API +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.** + +Each event can record up to 100 feature flag evaluations; if more are sent, only the most recent 100 are kept. + +```php +\Sentry\addFeatureFlag('test-flag', false); + +\Sentry\captureException(new \RuntimeException("Something went wrong!")); +``` + +Go to your Sentry project and confirm that your error event has recorded the feature flag "test-flag" and its value "false".