node_exporter icon indicating copy to clipboard operation
node_exporter copied to clipboard

enhancement: add feature gate support

Open rexagod opened this issue 1 year ago • 7 comments

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]

rexagod avatar May 24 '24 01:05 rexagod

For cases such as https://github.com/prometheus/node_exporter/issues/1945#issuecomment-1628913423.

rexagod avatar May 24 '24 02:05 rexagod

cc @SuperQ @discordianfish

Happy to answer any questions around this.

rexagod avatar May 27 '24 04:05 rexagod

I'm not sure we really need this. We've handled feature transitions with simple boolean flags.

SuperQ avatar May 27 '24 05:05 SuperQ

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.

rexagod avatar May 27 '24 07:05 rexagod

That being said, if you think we are better off without these, PLMK and I'll close this.

rexagod avatar May 27 '24 07:05 rexagod

@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).

rexagod avatar Jun 21 '24 23:06 rexagod

I believe this should establish a robust and streamlined way of gating features here, re-pinging @SuperQ and @discordianfish for a look. 🙂

rexagod avatar Oct 19 '24 17:10 rexagod

This failed to gain traction. Closing.

rexagod avatar Oct 22 '24 15:10 rexagod