Adding an all_available_flags
behavior to providers and clients
#338
Replies: 5 comments 13 replies
-
I think this is a good idea. I can imagine that for some flag providers/servie when you want to querying all available flags you need to provide a different token? I assume you want this on both the server and web OpenFeature clients? Also I do wonder if we want to care and/or warn about potential cost implication of using these commands. Typically, bulk evaluation costs a lot more than a single flag evaluation in providers. I can imagine that for some providers when querying all available flags the same applies. |
Beta Was this translation helpful? Give feedback.
-
Hey @maxveldink, thanks for starting the discussion. The use case makes sense and would likely be straightforward to implement, at least on client-side SDKs. Extending provider metadata may be a good option, but we could do this in a couple of ways. How should the structure of the all flags object look? LaunchDarkly returns a map of flag keys and the values based on the current context. We could do something similar or possibly a list of evaluation details. |
Beta Was this translation helpful? Give feedback.
-
I agree, we have a use case where we want to use OpenFeature to have a single interface for multiple in-house feature flag providers and consolidate them on a single UI. Right now, we cannot fully use OpenFeature since there is no support for a |
Beta Was this translation helpful? Give feedback.
-
Hey @maxveldink, could you start a spec proposal? There seems to be sufficient demand for this feature. We should avoid adding a bulk evaluation API but providing a way to access the available flag keys seems valuable. |
Beta Was this translation helpful? Give feedback.
-
Started the proposal in this PR. |
Beta Was this translation helpful? Give feedback.
-
This is carried over from a thread in the OF Slack channel.
One use case our team has had to patch into our OF client (and provider implementations) is the ability to see all available flags for a given evaluation context. This is a feature available in LaunchDarkly (our primary provider) and a few other providers as well.
Note. This is different from
bulk_flag_evaluation
(as discussed here). Our code needs to know the flag keys to evaluate this particular use case beforehand. We want to query an OF client (and, by proxy, the provider) to see all available flag keys for a given context.There are two motivating uses for this:
Our current patch adds two new methods to the provider and client interfaces. This seems too large of a change to support a use case that not all providers support.
One idea was to include this as optional behavior on the
provider metadata
object. We don't store much here right now, and it feels different enough than flag evaluation that adding a new, required method implementation for all providers seems overly restrictive. We'd then be able to access provider metadata through the client's metadata (which I don't believe is currently a part of the spec).Further, maybe this is an opportunity to add a more general, optional key-value storage to provider metadata. We store some non-standard information in our in-house providers, but we might want to shore those up more in the spec.
I'm curious if others have a similar need for this behavior, how they've approached it, and if we're open to adding something to the specification to standardize this concept. 🙏🏻
Beta Was this translation helpful? Give feedback.
All reactions