Set Up Feature Flags
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.
- Laravel SDK version
4.19.0or above.
If you use Laravel Pennant together with the Sentry Laravel SDK, Sentry automatically tracks your feature flag evaluations for you.
When using rich values, it is important to know that a feature is considered "active" when it has any value other than false.
Each event can record up to 100 feature flag evaluations; if more are sent, only the most recent 100 are kept.
Copied
use Laravel\Pennant\Feature;
if (Feature::active('test-flag')) {
// do some work
}
\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 evaluated value.
Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").