From bb853cf45837334d168dae8249f82767c87c7c12 Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Mon, 10 Nov 2025 12:59:43 +0100 Subject: [PATCH 1/4] add documentation for php feature flags --- docs/platforms/php/common/feature-flags/index.mdx | 14 ++++++++++++++ .../evaluation-tracking-index/php.mdx | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 docs/platforms/php/common/feature-flags/index.mdx create mode 100644 platform-includes/feature-flags/evaluation-tracking-index/php.mdx 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 0000000000000..4e330d609f955 --- /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.0` 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 0000000000000..7a83db769a058 --- /dev/null +++ b/platform-includes/feature-flags/evaluation-tracking-index/php.mdx @@ -0,0 +1,10 @@ +### 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.** + +```php +\Sentry\addFeatureFlag('test-flag', false); + +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". From 731463314bfa49e094ecacef36735d4afb563946 Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Mon, 10 Nov 2025 13:02:01 +0100 Subject: [PATCH 2/4] version fix --- docs/platforms/php/common/feature-flags/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/php/common/feature-flags/index.mdx b/docs/platforms/php/common/feature-flags/index.mdx index 4e330d609f955..821c49ff43d5a 100644 --- a/docs/platforms/php/common/feature-flags/index.mdx +++ b/docs/platforms/php/common/feature-flags/index.mdx @@ -7,7 +7,7 @@ description: With Feature Flags, Sentry tracks feature flag evaluations in your ## Prerequisites -- [Sentry SDK](/) version `4.18.0` or above. +- [Sentry SDK](/) version `4.18.1` or above. ## Enable Evaluation Tracking From 05b9c1c1986ddf25fcd32df8adaecbc7aa3f4e9f Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Mon, 10 Nov 2025 16:14:13 +0100 Subject: [PATCH 3/4] fix namespace --- .../feature-flags/evaluation-tracking-index/php.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/feature-flags/evaluation-tracking-index/php.mdx b/platform-includes/feature-flags/evaluation-tracking-index/php.mdx index 7a83db769a058..0c96e1085eaf1 100644 --- a/platform-includes/feature-flags/evaluation-tracking-index/php.mdx +++ b/platform-includes/feature-flags/evaluation-tracking-index/php.mdx @@ -4,7 +4,7 @@ You can use the generic API to manually track feature flag evaluations. These ev ```php \Sentry\addFeatureFlag('test-flag', false); -captureException(new \RuntimeException("Something went wrong!")); +\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". From 42f0e7b1016207001525c3b07d531d92cec90998 Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Tue, 11 Nov 2025 10:04:22 +0100 Subject: [PATCH 4/4] add count --- .../feature-flags/evaluation-tracking-index/php.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform-includes/feature-flags/evaluation-tracking-index/php.mdx b/platform-includes/feature-flags/evaluation-tracking-index/php.mdx index 0c96e1085eaf1..a39fb9d3d9b91 100644 --- a/platform-includes/feature-flags/evaluation-tracking-index/php.mdx +++ b/platform-includes/feature-flags/evaluation-tracking-index/php.mdx @@ -1,6 +1,8 @@ ### 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);