You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Define OTel Semantic Convention for Feature Flagging #30
OpenTelemetry has a concept of semantic conventions. This is a form of metadata that can be applied to a span. The attribute names should comply with their spec.
Here's an initial draft of properties that may be valuable.
Attribute
Type
Description
Examples
Required
feature_flag.flag_key
string
The unique identifier of the feature flag.
show-new-logo
Yes
feature_flag.provider.name
string
The name of the provider performing the flag evaluation.
Flag Manager
No
feature_flag.provider.management_url
string
The URL used to manage the feature flag in the provider.
It would be useful to also know the expected return type and the value. This becomes a bit tricky when dealing with JSON. In that case, we could either omit the property or create a hash.
In my world, we have a flag. Flags have rules. Rules will help you slot a user into a particular variant.
e.g. "redesign_enabled" flag might have variants "yes" and "no". I need that name in the OT output, as the value may change over time (and/or be big) but the names should be more stable.
@justinabrahms I think what I'm calling "evaluated value" you're calling "variant name", right? Not advocating for one over the other, just making sure I'm understanding your meaning
@moredip "evaluated value" sounds like the resulting data type, I think. I want a name for that value type. So the value for "yes" would be true.
Another example:
feature name: header_order
rule: if they're in germany, give "wonky" order.
rule: if they're in england, give "reverse" order
variants:
wonky: 1,4,3,2
reverse: 4,3,2,1
default: 1,2,3,4
In this example, I want "reverse" to be sent to OTel, not "4,3,2,1". Does that help?
Oh thanks, the example helps! So "evaluated value" would be the actual value that the Application Author is getting back from the flag decision call, and "variant name" is the semantic name for that value?
While I see the distinction you're making between the flag value and the semantic name for that value, I'm not sure it can be meaningfully mapped to all (or even most) vendors.
How do we abstract this in vendors that don't really carry the "variant" concept?
feature_flag.flag_id or feature_flag.flag_name would be less ambiguous, IMHO. (rather than feature_flag.id)
@moredip, that makes sense. Unfortunately, there doesn't seem to be a clear term used by the industry. A quick look shows that name, key, and identifier is commonly used. I would prefer feature_flag.flag_id but feature_flag.flag_key would also make sense to me.
Thanks @justinabrahms, I've updated the proposal based on your suggestions. I'm wondering if having the variant name would reduce or eliminate the need for the evaluation value itself. For now, I've left it in but perhaps it should be removed.
I'm wondering if having the variant name would reduce or eliminate the need for the evaluation value itself.
I'm concerned about data size, but maybe we also need to know what was actually in there? Users may be able to update variant plums from value "yummy" to "Turns out, I don't like them" and the telemetry wouldn't know the difference otherwise. Is that important? I don't think it is important to my use-case, but may be to someone's.
@justinabrahms, I agree that the variant name would be best in situations where the result is not a boolean value. However, in those situations, the variant name could simply be the boolean value. If we did that, removing feature_flag.evaluated.value may make sense. What do you think?
Is a byte array possible in any of these systems? Maybe good to include just for future-proofing
I haven't see byte array support from any existing vendor SDKs. A few mention strings are UTF-8 encoding explicitly, I suspect that's universally the case, though I'm not 100% sure. I suspect that most vendors would recommend base64 if there was a desire to store binary.
Is a byte array possible in any of these systems? Maybe good to include just for future-proofing
I haven't see byte array support from any existing vendor SDKs. A few mention strings are UTF-8 encoding explicitly, I suspect that's universally the case, though I'm not 100% sure. I suspect that most vendors would recommend base64 if there was a desire to store binary.
Most vendors maybe but you don't want to exclude the possible future vendor who wants to support byte sequences
Activity
beeme1mr commentedon Mar 30, 2022
It would be useful to also know the expected return type and the value. This becomes a bit tricky when dealing with JSON. In that case, we could either omit the property or create a hash.
moredip commentedon Mar 31, 2022
feature_flag.flag_idorfeature_flag.flag_namewould be less ambiguous, IMHO. (rather thanfeature_flag.id)moredip commentedon Mar 31, 2022
Wouldn't we want to standardize an attribute that indicates the evaluated value of the flag?
feature_flag.evaluated_value, or justfeature_flag.flag_value?justinabrahms commentedon Mar 31, 2022
The thing I'm missing here is "variant name".
In my world, we have a flag. Flags have rules. Rules will help you slot a user into a particular variant.
e.g. "redesign_enabled" flag might have variants "yes" and "no". I need that name in the OT output, as the value may change over time (and/or be big) but the names should be more stable.
moredip commentedon Mar 31, 2022
@justinabrahms I think what I'm calling "evaluated value" you're calling "variant name", right? Not advocating for one over the other, just making sure I'm understanding your meaning
justinabrahms commentedon Mar 31, 2022
@moredip "evaluated value" sounds like the resulting data type, I think. I want a name for that value type. So the value for "yes" would be
true.Another example:
In this example, I want "reverse" to be sent to OTel, not "4,3,2,1". Does that help?
moredip commentedon Mar 31, 2022
Oh thanks, the example helps! So "evaluated value" would be the actual value that the Application Author is getting back from the flag decision call, and "variant name" is the semantic name for that value?
justinabrahms commentedon Mar 31, 2022
@moredip You've got it! I've attempted to document what I've said here: #31
toddbaert commentedon Mar 31, 2022
@justinabrahms I made a similar comment in your recent PR: https://github.com/open-feature/spec/pull/31/files . I'll repeat it here:
justinabrahms commentedon Mar 31, 2022
I'll keep the convo on that thread, but interested in solving that. :)
beeme1mr commentedon Mar 31, 2022
@moredip, that makes sense. Unfortunately, there doesn't seem to be a clear term used by the industry. A quick look shows that
name,key, andidentifieris commonly used. I would preferfeature_flag.flag_idbutfeature_flag.flag_keywould also make sense to me.beeme1mr commentedon Mar 31, 2022
Thanks @justinabrahms, I've updated the proposal based on your suggestions. I'm wondering if having the variant name would reduce or eliminate the need for the evaluation value itself. For now, I've left it in but perhaps it should be removed.
justinabrahms commentedon Mar 31, 2022
I'm concerned about data size, but maybe we also need to know what was actually in there? Users may be able to update variant
plumsfrom value"yummy"to"Turns out, I don't like them"and the telemetry wouldn't know the difference otherwise. Is that important? I don't think it is important to my use-case, but may be to someone's.beeme1mr commentedon Apr 1, 2022
@justinabrahms, I agree that the variant name would be best in situations where the result is not a boolean value. However, in those situations, the variant name could simply be the boolean value. If we did that, removing
feature_flag.evaluated.valuemay make sense. What do you think?justinabrahms commentedon Apr 1, 2022
@beeme1mr super happy with that.
7 remaining items
toddbaert commentedon Apr 5, 2022
I haven't see byte array support from any existing vendor SDKs. A few mention strings are UTF-8 encoding explicitly, I suspect that's universally the case, though I'm not 100% sure. I suspect that most vendors would recommend base64 if there was a desire to store binary.
dyladan commentedon Apr 5, 2022
Most vendors maybe but you don't want to exclude the possible future vendor who wants to support byte sequences
[-]Define Semantic Convention for Feature Flagging[/-][+]Define OTel Semantic Convention for Feature Flagging[/+]beeme1mr commentedon Dec 1, 2022
Success!
chore: bump js-yaml transitive dep to 3.15.0 (alert #30)
chore: resolve open dependabot security alerts (#395)