Skip to content
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

Document feature flags #976

Closed
gavincabbage opened this issue Apr 24, 2020 · 2 comments
Closed

Document feature flags #976

gavincabbage opened this issue Apr 24, 2020 · 2 comments
Assignees
Labels
hold off Should not be merged or address yet

Comments

@gavincabbage
Copy link

gavincabbage commented Apr 24, 2020

Document procedure for adding, consuming and changing feature flags.

The PR below adds feature flag capabilities to InfluxDB to allow users to exercise experimental features before they are enabled by default.

A feature flag is created by updating flags.yml and running make flags. It includes a default value.

A feature flag is then consumed in code:

  • On the backend, a flag can be used like this
if feature.MyFeatureFlag().Enabled(ctx) {
    // new code path...
} else {
    // old code path...
}
  • On the frontend, a similar pattern can be used based on the response from /api/v2/flags

Finally, the value of a flag can be changed from the default using the INFLUXD_FEATURE_FLAGS environment variable or --feature-flags CLI flag. In the first case, the environment variable should be formatted as a JSON map of string keys to string values, e.g.

env INFLUXD_FEATURE_FLAGS="{\"flag1\":\value1\",\"key2\":\"value2\"}" influxd

In the the second case, the flag value should be formatted as a comma-delimted list of key-value pairs, with an equals sign as an assignment operator, e.g.

influxd --feature-flags flag1=value1,flag2=value2
Relevant URLs
What products and version are you using?

InfluxDB 2.0

@noramullen1
Copy link
Contributor

Hi @gavincabbage , is this a feature just for internal use?

@sanderson
Copy link
Collaborator

@noramullen1 @gavincabbage There has been discussion around leaving this feature undocumented. I don't know that we've come to a consensus yet, but I think we better put this on hold.

@sanderson sanderson added the hold off Should not be merged or address yet label May 18, 2020
@sanderson sanderson self-assigned this Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hold off Should not be merged or address yet
Projects
None yet
Development

No branches or pull requests

3 participants