mirror of
https://github.com/grafana/grafana.git
synced 2024-12-25 08:21:46 -06:00
4e99cd2860
* Edit deprecation-policy * Edit drone-pipeline * Docs: Edit of 4 files, part 2 of quality improvement * Update contribute/developer-guide.md * Update contribute/developer-guide.md Co-authored-by: J Stickler <julie.stickler@grafana.com> * Changes from feedback * Properly style UNIX * Update contribute/drone-pipeline.md * Update contribute/feature-toggles.md Co-authored-by: J Stickler <julie.stickler@grafana.com> * Format with prettier --------- Co-authored-by: J Stickler <julie.stickler@grafana.com>
1.4 KiB
1.4 KiB
Feature toggle guide
This guide helps you to add your feature behind a feature flag, code that lets you enable or disable a feature without redeploying Grafana.
Steps to adding a feature toggle
- Define the feature toggle in registry.go. To see what each feature stage means, look at the related comments. If you are a community member, use the CODEOWNERS file to determine which team owns the package you are updating.
- Run the Go tests mentioned at the top of this file. This generates all the additional files needed:
toggles_gen
for the backend,grafana-data
for the frontend, and docs. To run the test, runmake gen-feature-toggles
.
How to use the toggle in your code
Once your feature toggle is defined, you can then wrap your feature around a check if the feature flag is enabled on that Grafana instance.
Examples: