From bb853cf45837334d168dae8249f82767c87c7c12 Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Mon, 10 Nov 2025 12:59:43 +0100 Subject: [PATCH 1/5] 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 00000000000000..4e330d609f955e --- /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 00000000000000..7a83db769a0585 --- /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/5] 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 4e330d609f955e..821c49ff43d5a6 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/5] 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 7a83db769a0585..0c96e1085eaf12 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/5] 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 0c96e1085eaf12..a39fb9d3d9b919 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); From 592b238ae4ab138e6f163e2704d697b6093f0286 Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Tue, 18 Nov 2025 15:54:22 +0100 Subject: [PATCH 5/5] update url to point to Sentry SDK explainer --- 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 821c49ff43d5a6..00d731146bde53 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.1` or above. +- [Sentry SDK](/platforms/php) version `4.18.1` or above. ## Enable Evaluation Tracking