Options Backed Features [DEPRECATED]

Options backed features using the OPTIONS strategy enum were a temporary stopgap that was used to formalize options-backed feature flags. These have since been replaced by Flagpole, which is Sentry's preferred means of setting feature flags now.

Building your options based feature

Declare your feature in sentry/features/temporary.py or sentry/features/permanent.py like so:

Copied
manager.add("organizations:your-new-flag", OrganizationFeature, FeatureHandlerStrategy.OPTIONS)

This automatically registers a feature handler for you in getsentry, and also auto registers the relevant options.

To roll out your feature, you'll want to set the rollout options via options automator. To figure out the options you need to configure, you can run the following script in getsentry:

Copied
./bin/generate_automator_feature_options.py --flag organizations:your-new-flag

It will then produce output like

Copied
Generating automator options for feature flag `organizations:your-new-flag`
Add these to the appropriate file in options automator to roll out your feature
For example, to roll out in the US, you can add them to https://github.com/getsentry/sentry-options-automator/blob/main/options/regions/us/app.yaml
To roll out to all production regions, you can add them to https://github.com/getsentry/sentry-options-automator/blob/main/options/default/app.yaml
Options:
  organizations.your-new-flag.la-rollout: 0.0
  organizations.your-new-flag.ea-rollout: 0.0
  organizations.your-new-flag.ga-rollout: 0.0
  organizations.your-new-flag.la-orgs: [
    "codecov",
    "sentry",
    "sentry-sdks",
    "sentry-test",
    "sentry-st",
    "sentry-emerging-tech",
    "specto-dev",
  ]

Open a pr in https://github.com/getsentry/sentry-options-automator to set these options and you can roll out your feature flag. You can also customize which orgs will be in your la rollout by modifying la-orgs

You can edit this page on GitHub.