node_exporter
node_exporter copied to clipboard
enhancement: add feature gate support
Allow APIs to be gated conditionally.
Feature gates can be enforced by default, or overridden by the user. The latter takes priority if both cases conflict. Feature gates can be enabled, or disabled, and thus have two custom states. Note that the default state for a feature gate is nil, allowing us to distinguish if a feature gate is levied, raised, or not set.
Signed-off-by: Pranshu Srivastava [email protected]
For cases such as https://github.com/prometheus/node_exporter/issues/1945#issuecomment-1628913423.
cc @SuperQ @discordianfish
Happy to answer any questions around this.
I'm not sure we really need this. We've handled feature transitions with simple boolean flags.
Right, boolean flags surely are a possible solution. However, my inclination towards replacing them with feature gates was motivated by a couple of observations.
- The feature-gates model implemented here assures a proof of trust can be established between the users and the features using version specifications.
- Instead of adding deprecation notice to boolean flags' help texts, we'd have a timeline for every feature right from their inception, allowing users to forethink their dependency on gated APIs. Extending version commitments is also possible.
- All feature-gates will be accumulated in a single document (and auto-updated), making it easier for the user to keep track of all additions.
That being said, if you think we are better off without these, PLMK and I'll close this.
@SuperQ @discordianfish I'd be happy to add this to the agenda and pitch it in the call next-to-next week if that sounds good (or have an async discussion here if that works).
I believe this should establish a robust and streamlined way of gating features here, re-pinging @SuperQ and @discordianfish for a look. 🙂
This failed to gain traction. Closing.