-
Notifications
You must be signed in to change notification settings - Fork 99
Update feature toggle targeting documentation #3115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c03d71d
69c3858
ac4552b
88573b8
ff53a6e
fdf8fa0
1850cbe
4bc7498
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "width": 3840, | ||
| "height": 1876, | ||
| "updated": "2026-04-24T04:00:00.000Z" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "width": 3840, | ||
| "height": 1882, | ||
| "updated": "2026-04-24T04:00:00.000Z" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "width": 3840, | ||
| "height": 1884, | ||
| "updated": "2026-04-24T04:00:00.000Z" | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "width": 3840, | ||
| "height": 1876, | ||
| "updated": "2026-04-24T04:00:00.000Z" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "width": 2704, | ||
| "height": 1486, | ||
| "updated": "2025-08-01T08:52:49.163Z" | ||
| "width": 3840, | ||
| "height": 1874, | ||
| "updated": "2026-04-24T04:00:00.000Z" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,71 +1,99 @@ | ||
| --- | ||
| layout: src/layouts/Default.astro | ||
| pubDate: 2026-04-20 | ||
| modDate: 2026-04-20 | ||
| modDate: 2026-04-28 | ||
| title: Targeting | ||
| subtitle: Control rollout within an environment | ||
| subtitle: Configure rollout within an environment | ||
| icon: fa-solid fa-bullseye | ||
| navTitle: Targeting | ||
| navSection: Feature Toggles | ||
| description: Targeting options for Octopus Feature Toggles | ||
| navOrder: 96 | ||
| --- | ||
|
|
||
| ## Minimum version | ||
|
|
||
| You can configure a feature toggle to require a minimum version before being enabled in an environment. The toggle will be enabled once that version (or any later version) is deployed to that environment. | ||
|
|
||
|  | ||
|
|
||
| ## Tenants {#tenants} | ||
|
|
||
| If your Project uses [Tenants](/docs/tenants/), then Toggles may be enabled for subsets of your Tenants. | ||
| If your project uses [Tenants](/docs/tenants/), you can configure a feature toggle to be enabled for subsets of your tenants within an environment. | ||
|
|
||
| The options for configuring a Feature Toggle for Tenants are: | ||
| There are many options for configuring a feature toggle for tenants. These are all modeled in Octopus and do not require any custom configuration in application code. | ||
|
|
||
| - All Tenants | ||
| - Specific Tenants Included | ||
| - % of Tenants | ||
| - Specific Tenants Excluded | ||
| ### Excluded tenants | ||
|
|
||
| For example, the configuration shown below will result in the Toggle evaluating as `On` for 10% of Tenants, always including `Acme` and never including `Cyberdyne Systems`. | ||
| You can exclude tenants individually or exclude groups of tenants using tenant tags. Excluded tenants will always override any other rollout configuration, even if the rollout percentage is set to 100%. | ||
|
|
||
|  | ||
|  | ||
|
|
||
| ## Segments {#segments} | ||
| Once a feature toggle is configured with an excluded tenant tag, any changes to tenant tag assignments apply immediately to feature toggles (no update to the feature toggle configuration is required). | ||
|
|
||
| Segments allow enabling a toggle for a subset of users. | ||
| ### Included tenants | ||
|
|
||
| Segments are key/value pairs, and are supplied by your applications via the [OpenFeature EvaluationContext](https://openfeature.dev/docs/reference/concepts/evaluation-context). | ||
| You can enable feature toggles for individual tenants. These tenants will always be included, even if the tenant rollout percentage is set to 0%. | ||
|
|
||
| Common segment examples include: | ||
|  | ||
|
|
||
| ### Tenant rollout | ||
|
|
||
| Tenant rollout allows you to enable a toggle for a pseudorandom percentage of all tenants. | ||
|
|
||
| The included tenants are determined using a MurmurHash of the tenant ID and a toggle-specific key. This guarantees deterministic evaluation for any given tenant and toggle combination, while ensuring that a different set of tenants is included for each toggle. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Note to update after rollout groups goes out?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll likely keep this as it currently is once we release rollout groups. At this point in the documentation I don't want people to have to understand rollout groups, just that every toggle will be evaluated differently. I'll use the rollout group section to explain that you can link this between feature toggles. |
||
|
|
||
|  | ||
|
|
||
| You can further restrict the rollout using tenant tags. For example, if you specify `Region/Australia`, `Region/Europe`, and `Tier/Enterprise`, a 50% rollout will only apply to 50% of Enterprise tenants in either Australia or Europe. If you do not specify any tenant tags, a 50% rollout will apply to 50% of all tenants. | ||
|
|
||
| - Specific users. e.g. `user-id/123456` | ||
| - Specific accounts. e.g. `account-id/123456` | ||
| - License types. e.g. `license-type/free` | ||
| - Geographic regions. e.g. `region/eu` | ||
| - Rollout rings. e.g. `ring/early-adopter` | ||
| As with excluded tenants, any changes to tenant tags apply immediately to feature toggles. | ||
|
|
||
| The Evaluation Context can be supplied at different points in your application, for example: | ||
| ## Client rollout | ||
|
|
||
| - On start-up | ||
| - During each web request | ||
| - At the evaluation site | ||
| Client rollout allows you to enable a toggle for a random percentage of your application users. The included users are determined using a MurmurHash of the [OpenFeature Targeting Key](https://openfeature.dev/docs/reference/concepts/evaluation-context#targeting-key) and a toggle-specific key. This guarantees deterministic evaluation for any given user and toggle combination. | ||
|
|
||
| The following example shows adding a key/value to the evaluation context in C#. | ||
| To use client rollout, you must configure a targeting key in your OpenFeature client. Refer to the [OpenFeature SDK](https://openfeature.dev/docs/reference/sdks/) documentation for your development language for details on how to set the targeting key. If you do not set a targeting key, the feature toggle will not be enabled for any users unless the rollout is set to 100%. | ||
|
|
||
| ```cs | ||
| // The client would be injected by IoC in many cases | ||
| var client = OpenFeature.Api.Instance.GetClient(); | ||
| // The following is hard-coded, whereas a real-world use would set this dynamically | ||
| client.SetContext(EvaluationContext.Builder().Set("license-type", "free").Build()); | ||
| ``` | ||
| You should set the targeting key to a value that uniquely identifies your evaluation subject. For most applications, this will be a user identifier (such as a user ID), but you can use any identifier that suits your needs (for example, team, region, or server instance). | ||
|
|
||
| Segments can then be configured for Environments on the Feature Toggle in Octopus. | ||
| :::div{.warning} | ||
| Support for client rollout percentages was added in the following versions of the [provider libraries](/docs/feature-toggles/providers): | ||
|
|
||
| - [.NET: `2.1.0`](https://github.com/OctopusDeploy/openfeature-provider-dotnet/releases/tag/v2.1.0) | ||
| - [Java: `0.3.0`](https://github.com/OctopusDeploy/openfeature-provider-java/releases/tag/0.3.0) | ||
| - [TypeScript/JavaScript: `3.0.0`](https://github.com/OctopusDeploy/openfeature-provider-ts-web/releases/tag/v3.0.0) | ||
|
dylanlerch marked this conversation as resolved.
|
||
|
|
||
| If you are not running the required minimum version of these libraries, the rollout percentage will be ignored (and handled as if the value was set to 100%). | ||
| ::: | ||
|
|
||
| ### Segments {#segments} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't recall, but did we say that at some point we should call out that segments are sent to clients so shouldn't contain sensitive values?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't recall either. Keen to get this merged so I won't add this now. I'm not against having it in here. |
||
|
|
||
| Segments allow you to further refine the client rollout for a toggle based on data that is not modeled in Octopus. Segments are key/value pairs, and are supplied by your application via the [OpenFeature evaluation context](https://openfeature.dev/docs/reference/concepts/evaluation-context). | ||
|
|
||
| Like tenant targeting, segments are configured per-environment on the feature toggle in Octopus. | ||
|
|
||
|  | ||
|
|
||
| Refer to the [OpenFeature SDK](https://openfeature.dev/docs/reference/sdks/) documentation for your development language for more details on how to set these values. | ||
|
|
||
| Common segment examples include: | ||
|
|
||
|  | ||
| - Specific users (e.g. `user-id/123456`) | ||
| - Specific accounts (e.g. `account-id/123456`) | ||
| - License types (e.g. `license-type/free`) | ||
| - Geographic regions (e.g. `region/eu`) | ||
| - Rollout rings (e.g. `ring/early-adopter`) | ||
|
|
||
| A Toggle evaluation will match on segments if the evaluation context matches at least one segment for each key. | ||
| A feature toggle evaluation will match on segments if the evaluation context matches at least one segment for each key. If you specify `ring/early-adopter`, `region/eu`, and `region/au`, the rollout will apply only to users in the early-adopter ring who are in either the EU or AU regions. If you do not specify any segments, the rollout will apply to all users. | ||
|
|
||
| Some examples: | ||
|
|
||
| | Segments | Evaluation Context | Result | | ||
| |-----------------------------------------------|-----------------------------------|--------| | ||
| | `user-id/123456` | `user-id/123456` | `On` | | ||
| | `user-id/123456` | `user-id/789383` | `Off` | | ||
| | `license-type/free` `region/Asia` `region/EU` | `license-type/free` `region/Asia` | `On` | | ||
| | `license-type/free` `region/Asia` `region/EU` | `license-type/free` `region/US` | `Off` | | ||
| | Segments | Evaluation Context | Result | | ||
| |------------------------------------------------|-----------------------------------|--------| | ||
| | `user-id/123456` | `user-id/123456` | `On` | | ||
| | `user-id/123456` | `user-id/789383` | `Off` | | ||
| | `ring/early-adopter`, `region/eu`, `region/au` | `ring/early-adopter`, `region/eu` | `On` | | ||
| | `ring/early-adopter`, `region/eu`, `region/au` | `ring/early-adopter`, `region/au` | `On` | | ||
| | `ring/early-adopter`, `region/eu`, `region/au` | `license-type/free` | `Off` | | ||
| | `ring/early-adopter`, `region/eu`, `region/au` | `region/au` | `Off` | | ||
Uh oh!
There was an error while loading. Please reload this page.