Getting Started

Configs Anatomy

Detailed description of configs and their attributes and properties

Config attributes

Configs have the following attributes:

Key

  • An identifier for the config. This is how the config will be referenced in code via the SDKs, and how it will be presented in the dashboard.
  • Must be unique across the entire project
  • Can only contain letters, numbers, periods, dashes, and underscores
  • It is recommended to follow a consistent naming convention that is descriptive
  • ConfigDirector provides the ability to safely rename the key, even for configs that are actively being used. Each old key keeps working alongside the new one for at least 35 days and until it is no longer used, and then it is removed. Dynamic Detection explains how ConfigDirector tells that an old key is no longer used.
  • A config can keep up to two old keys at a time, so you can rename it again before an earlier old key is removed. Once it has two, you can rename it after one of them is removed.
  • A config renamed within two hours of its creation, before any application has evaluated it and while no code scan references it, has its key replaced outright, with no old key kept.

Description

  • An optional description of the config. This can be a useful place to provide more context on how this config is used by applications, what its intention is, and any other useful context.

Role

  • The role of this config which can be one of Config, Feature flag, Experiment, or Kill switch
  • Each role offers different defaults and properties, more on this further below
  • The role is chosen when the config is created. A Feature flag can later become a Kill switch and a Kill switch a Feature flag, from the config's Settings tab; the role is never updated otherwise

Lifetime

  • It can be Permanent or Temporary
  • Permanent configs are meant for values that are planned to remain in place for the foreseeable future. ConfigDirector will not generate any alerts whenever it detects that a Permanent config may no longer be in use.
  • On the other hand, Temporary configs are meant to be used for short term values (for example a feature flag) that should be removed once it is no longer needed. ConfigDirector will track and notify when it detects a Temporary config may no longer be needed. See Config Lifecycle for how that is decided.
  • The role decides the lifetime of every role but Config: a Feature flag and an Experiment are always Temporary, a Kill switch is always Permanent. Only a Config chooses its lifetime, and can change it later from the Settings tab.

SDK Availability

  • Determines if the given config should be available to server SDKs, client SDKs, or both
  • Some config values may only be relevant to clients, in which case selecting only Client SDK in the availability will exclude them from server SDKs. This can help reduce the payload size which may be relevant for projects with a large number of configs and/or configs with large values (such as JSON and JSON schemas).
  • Conversely, some config values may only be meant for server side applications and including them in the client payload may be undesirable for a variety of reasons (payload size, publicly exposing server config data, etc)

Type

  • Feature flags and kill switches are always boolean
  • Configs can be of a variety of types: Boolean, String, Integer, Float, Enum, URL, Timespan, JSON
  • URL configs hold an HTTP or HTTPS URL. The SDKs return it as a string.
  • Timespan configs hold a duration in milliseconds, seconds, or minutes. The SDKs return the number exactly as it was entered: the unit labels the value in the dashboard, and no unit conversion takes place.
  • Experiments can be based on: Boolean, String, Integer, Float. Experiments are based on pre-defined variations, so the Enum type is redundant and it's excluded from the available types.

Constraints

  • Some types, like Integer, Float, URL, and Timespan, allow for constraints to be defined
  • Integer and Float configs can have a minimum and a maximum value.
  • URL configs can be restricted to HTTPS only. New URL configs start with this restriction on.
  • Timespan configs always have a minimum and a maximum value, and only accept whole numbers unless fractional values are allowed.
  • The constraints can be used to restrict the values that the config is allowed to return. The constraints are enforced in the dashboard and the admin API whenever targeting rules are updated.
  • Constraints can be an additional layer of safety to prevent unwanted values from being configured by mistake. For example, if a config is meant to represent a timeout value, constraints can be used to enforce the value is within an acceptable range.
  • JSON configs can be validated against a JSON Schema. See JSON Schema Validation for how it works and the limits that apply.

Roles

Configs

Config is the default role and what provides the most flexibility. This role is meant for any arbitrary configuration value (excluding secrets) needed by applications.

Feature flags & Kill switches

Feature Flags and Kill Switches are boolean configs that behave very similarly but have slightly different defaults and meanings.

A Feature flag is always temporary: it is meant for short-lived flags that will be removed once the feature is fully released.

On the other hand, a Kill switch is always permanent: it is meant to remain in place for the foreseeable future as a means to enable/disable a given feature when needed.

A feature flag that has become a long-term toggle can be updated to a kill switch from the config's Settings tab, and a kill switch that turns out to be short-lived to a feature flag. Both roles are boolean, so the config keeps its key, its targeting rules in every environment, its tags and its SDK availability.

Experiments

An Experiment is always temporary and serves variations you compare against each other, and Experiments walks through running one from start to finish.

Copying a config

A config can be copied from its Settings tab: Copy config… creates a new config from it, with the same definition, tags and every environment's targeting rules, under a key you choose, in the same project or in another project of your organization. The copy starts its own life as a new config and shares nothing with the original afterwards; its old keys, lifecycle state and activity are not carried over, and an archived config has to be restored before it can be copied. A percentage rollout in the copy assigns contexts to its shares on its own, so a user may land in a different share than in the original.

When the copy goes to another project, environments are matched by slug, tags by name and segments by key. Each environment of the destination project copies the rules of the source environment with the same slug; an environment that exists only in the source is left out, and for one that exists only in the destination you pick the source environment it starts with. A tag the destination does not have yet is created there, or left out when you cannot create tags in that project. A rule that targets a segment keeps working when the destination has a segment with the same key; otherwise the rule is dropped, and the preview names every dropped rule before you confirm. Nothing else is created in the destination: create the segment there first and copy again to bring the rule along. The Admin API offers the same operation with a dry run.