-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(flags): Include version and other feature flag details in /decide
response
#29693
Labels
enhancement
New feature or request
feature/feature-flags
Feature Tag: Feature flags
team/feature-flags
Comments
In keeping with OpenFeature, I may name the top-level property |
haacked
added a commit
that referenced
this issue
Mar 11, 2025
This contains details about each flag evaluation. The format is designed to be compatible with OpenFeature clients (though for them to work, we may still need to implement a provider). Related to #29693
haacked
added a commit
that referenced
this issue
Mar 11, 2025
This contains details about each flag evaluation. The format is designed to be compatible with OpenFeature clients (though for them to work, we may still need to implement a provider). Related to #29693
haacked
added a commit
that referenced
this issue
Mar 11, 2025
This contains details about each flag evaluation. The format is designed to be compatible with OpenFeature clients (though for them to work, we may still need to implement a provider). Related to #29693
haacked
added a commit
that referenced
this issue
Mar 11, 2025
This contains details about each flag evaluation. The format is designed to be compatible with OpenFeature clients (though for them to work, we may still need to implement a provider). Related to #29693 Return 0 if version is null Fix mypy errors
haacked
added a commit
that referenced
this issue
Mar 12, 2025
This implements a new shape for `/decide` in v4. This replaces the top-level `featureFlags` and `featureFlagPayloads` hashes with a simple `flags` hash. Each key is mapped to a feature flag detail object that contains all the info we need: - evaluation result - variant - payload - version - reason - other metadata While not a primary goal, the shape of the response is inspired by Open Feature. Open Feature doesn't specify how the JSON response has to look, but looking at the other providers, there are common patterns they all implement. Following these patterns will make implemeting an Open Feature provider easier (I hope). Even without that in mind, they're good patterns. Related to #29693
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
feature/feature-flags
Feature Tag: Feature flags
team/feature-flags
Feature request
Right now, it can be difficult for users to understand why a flag evaluated the way it did. It's especially difficult because a flag may have changed since the
$feature_flag_called
event. Anything we can do to provide more information is helpful.I'd like to include the
$flag_version
in the$feature_flag_called
event. To do this, we need to add more information in the/decide
response.Describe the solution you'd like
Today, feature flag information is in two different top-level properties of the
/decide
response body.I propose we add a new section named
featureFlagDetails
:You'll notice that information in
featureFlags
andfeatureFlagPayloads
is repeated there. This is for a few reasons.I modeled this new dictionary after the OpenFeature API. I'm not by any means suggesting we adopt it 100% right now. But no harm in moving to a format that OpenFeature clients will have an easier time with.
Second, our clients that understand this new format will have an easier time parsing this format and getting the info they need.
For example, down the road, we could add a
posthog.getFeatureFlagDetail(...)
method to each client that just grabs a node from this new/decide
response. This can reduce the requests that server-side clients need to make compared to callinggetFeatureFlag
and thengetFeatureFlagPayload
.Lastly, this format is scalable for new changes. For example, when we want to add a
reason
for a flag evaluation, we don't need to add a top-levelfeatureFlagReasons
property to the JSON.Debug info
The text was updated successfully, but these errors were encountered: