@@ -21,7 +21,12 @@ public final class FeatureFlagIncubatingAttributes {
2121 public static final AttributeKey <String > FEATURE_FLAG_EVALUATION_ERROR_MESSAGE =
2222 stringKey ("feature_flag.evaluation.error.message" );
2323
24- /** The reason code which shows how a feature flag value was determined. */
24+ /**
25+ * Deprecated, use {@code feature_flag.result.reason} instead.
26+ *
27+ * @deprecated Replaced by {@code feature_flag.result.reason}.
28+ */
29+ @ Deprecated
2530 public static final AttributeKey <String > FEATURE_FLAG_EVALUATION_REASON =
2631 stringKey ("feature_flag.evaluation.reason" );
2732
@@ -32,11 +37,9 @@ public final class FeatureFlagIncubatingAttributes {
3237 public static final AttributeKey <String > FEATURE_FLAG_PROVIDER_NAME =
3338 stringKey ("feature_flag.provider_name" );
3439
35- /**
36- * The identifier of the <a href="https://openfeature.dev/specification/glossary/#flag-set">flag
37- * set</a> to which the feature flag belongs.
38- */
39- public static final AttributeKey <String > FEATURE_FLAG_SET_ID = stringKey ("feature_flag.set.id" );
40+ /** The reason code which shows how a feature flag value was determined. */
41+ public static final AttributeKey <String > FEATURE_FLAG_RESULT_REASON =
42+ stringKey ("feature_flag.result.reason" );
4043
4144 /**
4245 * A semantic identifier for an evaluated flag value.
@@ -48,6 +51,21 @@ public final class FeatureFlagIncubatingAttributes {
4851 * understanding the meaning behind a value. For example, the variant {@code red} maybe be used
4952 * for the value {@code #c05543}.
5053 */
54+ public static final AttributeKey <String > FEATURE_FLAG_RESULT_VARIANT =
55+ stringKey ("feature_flag.result.variant" );
56+
57+ /**
58+ * The identifier of the <a href="https://openfeature.dev/specification/glossary/#flag-set">flag
59+ * set</a> to which the feature flag belongs.
60+ */
61+ public static final AttributeKey <String > FEATURE_FLAG_SET_ID = stringKey ("feature_flag.set.id" );
62+
63+ /**
64+ * Deprecated, use {@code feature_flag.result.variant} instead.
65+ *
66+ * @deprecated Replaced by {@code feature_flag.result.variant}.
67+ */
68+ @ Deprecated
5169 public static final AttributeKey <String > FEATURE_FLAG_VARIANT = stringKey ("feature_flag.variant" );
5270
5371 /**
@@ -57,7 +75,12 @@ public final class FeatureFlagIncubatingAttributes {
5775 public static final AttributeKey <String > FEATURE_FLAG_VERSION = stringKey ("feature_flag.version" );
5876
5977 // Enum definitions
60- /** Values for {@link #FEATURE_FLAG_EVALUATION_REASON}. */
78+ /**
79+ * Values for {@link #FEATURE_FLAG_EVALUATION_REASON}
80+ *
81+ * @deprecated Replaced by {@code feature_flag.result.reason}.
82+ */
83+ @ Deprecated
6184 public static final class FeatureFlagEvaluationReasonIncubatingValues {
6285 /** The resolved value is static (no dynamic evaluation). */
6386 public static final String STATIC = "static" ;
@@ -95,5 +118,43 @@ public static final class FeatureFlagEvaluationReasonIncubatingValues {
95118 private FeatureFlagEvaluationReasonIncubatingValues () {}
96119 }
97120
121+ /** Values for {@link #FEATURE_FLAG_RESULT_REASON}. */
122+ public static final class FeatureFlagResultReasonIncubatingValues {
123+ /** The resolved value is static (no dynamic evaluation). */
124+ public static final String STATIC = "static" ;
125+
126+ /**
127+ * The resolved value fell back to a pre-configured value (no dynamic evaluation occurred or
128+ * dynamic evaluation yielded no result).
129+ */
130+ public static final String DEFAULT = "default" ;
131+
132+ /**
133+ * The resolved value was the result of a dynamic evaluation, such as a rule or specific
134+ * user-targeting.
135+ */
136+ public static final String TARGETING_MATCH = "targeting_match" ;
137+
138+ /** The resolved value was the result of pseudorandom assignment. */
139+ public static final String SPLIT = "split" ;
140+
141+ /** The resolved value was retrieved from cache. */
142+ public static final String CACHED = "cached" ;
143+
144+ /** The resolved value was the result of the flag being disabled in the management system. */
145+ public static final String DISABLED = "disabled" ;
146+
147+ /** The reason for the resolved value could not be determined. */
148+ public static final String UNKNOWN = "unknown" ;
149+
150+ /** The resolved value is non-authoritative or possibly out of date */
151+ public static final String STALE = "stale" ;
152+
153+ /** The resolved value was the result of an error. */
154+ public static final String ERROR = "error" ;
155+
156+ private FeatureFlagResultReasonIncubatingValues () {}
157+ }
158+
98159 private FeatureFlagIncubatingAttributes () {}
99160}
0 commit comments