A feature flag (also known as a split) allows you to choose between different code paths in your system at runtime. Feature flags are an integral part of continuous delivery allowing you to decouple deployment from release. They also enable teams to safely merge new features, bug fixes, or other code changes to one central branch in the version control system, which avoids long-lived feature branches and merge issues by integrating code changes frequently.
Note: For additional information about feature flags, refer to Feature flag best practices. It explains how to implement feature-flagged software successfully, and offers tips on how to configure and manage a growing set of feature flags within your product, maintain them over time, manage infrastructure migrations, etc.
Creating a feature flag
When you create your feature flag, you can specify information for it, which includes a name, a description, owners, and tags. This information helps you and your team manage your feature flags and customize them to your team's workflow. To create a feature flag, do the following:
- From the left navigation, click Feature flags. The feature flags page displays.
- Click Create feature flag to create a new feature flag. The Create a feature flag panel appears.
- Enter the following information for your new feature flag. This information can help you and your team manage your feature flags and customize them to your team's workflow.
- Click Create feature flag to create your feature flag. Your new flag displays.
- To configure your feature flag for a particular environment, select the environment on the left panel, and click the Initiative environment button within the Definition tab.
From here, you can now create a rollout plan. This is also known as setting targeting rules. Refer to the Create a rollout plan guide for next steps in setting up your feature flag.
Note: When you set up an account, two environments are automatically created. If you want to create additional environments, refer to the Environments guide for more information.
Deleting a feature flag
To delete a feature flag, you first need to delete all targeting rules for that flag within all environments. To delete a feature flag, do the following:
- Select the feature flag you want to delete.
- Access the desired environment and click the (...) icon next to the KILL button and click Delete targeting rules. The Delete rules page appears.
- Type DELETE in the warning page field and then, in the Add approvers fields, optionally start typing users or groups.
Note: If you don’t add approvers, the feature flag is deleted immediately.
- Click the Delete button. If you haven’t selected approvers, the targeting rules are deleted.
- Repeat the same action for all environments that the feature flag is added to.
- Once you delete definitions, delete the feature flag by clicking the gear icon adjacent to the flag name.
Using the kill switch
If a feature flag negatively impacts performance or your user’s experience, you can kill it without changing targeting rules or performing a redeployment. When you kill a feature, all traffic is sent to the default treatment selected for that feature flag. To kill a feature flag, do the following:
- From the left navigation, click Feature flags. A list of feature flags appear.
- Select the desired feature flag and click Kill on the page. The Kill feature flag warning page opens.
- Type KILL in the warning page field.
- Optionally add a title, comment, or approver.
- Click the Kill button. The feature flag is now killed.
Using traffic types
When you create a feature flag, you must specify a traffic type. Use traffic types to identify the type of key you are using to split traffic. A traffic type is a particular identifier type for any hierarchy of your customer base. Traffic types in Split are customizable and can be any key you choose to send to Split, e.g., a user ID, account ID, device, persistent cookie, etc. The traffic type denotes the nature of the keys that is passed to getTreatment for that feature flag.
You can customize traffic types in Split to your particular use cases. You must have a traffic type for each type of key you plan to pass to getTreatment. The most commonly used traffic types are:
- user. The key uniquely identifies a known, logged-in user. To protect personally identifiable information (PII), never use email address or login name here. Instead, consider using either a numeric identifier that is the primary key in the table you use to store user information, or a hash of that primary key.
- anonymous. The key is a randomly generated identifier, like a uuid, that identifies a visitor using a particular mobile device or browser, where it is typically stored as a cookie.
- account. The key identifies the customer account to which the (logged-in) user belongs. This traffic type is often used to maintain consistency of behavior for all visitors from a given company or account.
Creating traffic types
You can create traffic types as needed at any time, but it’s a best practice to do so during your initial account setup, taking into account your anticipated needs. Once you create a feature flag with a given traffic type, that traffic type cannot be changed, so it is important to get it right the first time.
Note: Only administrators can create traffic types.
Split allows you to have up to ten traffic types per workspace. All environments within a workspace share the same set of traffic types. By default, a workspace has one traffic type named user when you first sign up for your account. You can customize your traffic types as needed during your setup.
To add your traffic types, do the following:
- From the left navigation, click at the top and select Admin settings.
- On Workspaces, select the workspace that you want to edit traffic types for.
- To add additional traffic types to a particular workspace, click View.
- Click the Actions button and then Add traffic type. The Create traffic type page appears.
- Enter a name for the traffic type and click Save. Be aware that once a traffic type is created, it cannot be edited.
- To delete a traffic type, in the Actions column, click the Delete link. You can only delete a traffic type if it is no longer used by any feature flags or metric definitions.
If you need assistance with traffic types, contact email@example.com.
Other traffic types
It is also possible for a traffic type to identify something other than a visitor. For instance, a realty site might use listing as a traffic type if they wanted to explore the possibility of having a single visitor see different appearances for different property listings. For that traffic type, the code would pass to getTreatment the id of the listing being displayed.
Another example of a less common but useful traffic type is pair, which represents a unique match of two users engaged in a dialog.
Use tags to organize and manage feature flags, segments, and metrics across the Split user interface. Tags can filter the display to focus on a particular team, feature release, portion of your app, or other organizational unit you use. We recommend creating tags that are specific to your workflow, for example:
- By team. Identify the responsible team using tags such as front end, infrastructure, web, or mobile.
- By feature release. Identify all of the feature flags associated with a particular release using tags such as reporting, new permissioning, or contact database migration.
- By feature flag type. Identify all the feature flags associated with paywalls or those that are permanent versus temporary, using tags such as paywall, permanent, or temporary.
Notes: Be aware that:
- Tag names of tags are case sensitive.
- Tags are shared across workspaces, so avoid giving them sensitive names you don't want all users in all workspaces to see.
To tag feature flags, segments, or metrics:
- Select what you want to tag.
- Click the gear icon next to the feature flag title and select Edit details. The Details panel appears.
- Select the desired tags and click the Save button.
Now that you've completed your first feature flag, you can set up your rollout plan.
Additional essential guides
The following are guides that walk you through additional capabilities of our Split application:
Refer to our Foundational concepts guide for more information about foundational concepts of the Split application..
Refer to our Setting up and using metrics guide to learn more about creating and using metrics in the Split application.