Using LaunchDarkly for percentage rollouts
To roll out a feature to a percentage of customers, we need to create and configure a feature flag. Chapter 3, Basics of LaunchDarkly and Feature Management, shows how to set one up. In this example, the only difference you will notice is that the name of the flag is different. For each example, you might want to create a new feature flag. Once you have created a new flag, we will start exploring percentage rollouts by looking at the Default rule property of the flag.
When creating a new Boolean flag, the Default rule property is set to true
. In Chapter 3, Basics of LaunchDarkly and Feature Management, we looked at how this works when the targeting of the feature flag is enabled to serve either true
or false
. However, there are three states a flag can be configured to serve:
- true
- false
- a percentage rollout
In this case, we will be looking at the third option, as shown in the following screenshot: