Skip to content

Integrate with Pennant feature flags #526

@martinbean

Description

@martinbean

Laravel launched Pennant, a feature flag package, alongside version 10.x of the framework.

Pennant raises events when resolving a known feature, so the Bugsnag package could hook in to this event and automatically declare a feature flag, as documented here: https://docs.bugsnag.com/platforms/php/laravel/features-experiments/

Code would look something like this:

$events->listen('Laravel\Pennant\Events\FeatureResolved', function ($event) {
    $this->app->bugsnag->addFeatureFlag($event->feature, $event->value);
});

It should probably be wrapped in a conditional so that developers can choose to enable or disable this automatically capturing of feature flag values, though. Maybe an environment variable-backed configuration value like BUGSNAG_CAPTURE_PENNANT_FEATURES or something.

Happy to code this up and open a PR if it’s something that would be welcomed in the package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogWe hope to fix this feature/bug in the futurefeature requestRequest for a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions