Skip to content

Define OTel Semantic Convention for Feature Flagging #30

Closed

Description

@beeme1mr

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. http://localhost:8080/flags/ No
feature_flag.evaluated.variant string The name associated with the evaluated value. [1] reverse See below
feature_flag.evaluated.value string A string representation of the evaluated value. [2] true See below

[1]: A variant should be used if it is available. If the variant is present, feature_flag.evaluated.value should be omitted.

[2]: The value should only be used if the variant is not available. How the value is represented as a string should be determined by the implementer.

Additional span attributes that already exist that may be useful in OpenFeature.

Activity

  1. beeme1mr commented on Mar 30, 2022

    @beeme1mr
    MemberAuthor

    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.

  2. moredip commented on Mar 31, 2022

    @moredip
    Member

    feature_flag.flag_id or feature_flag.flag_name would be less ambiguous, IMHO. (rather than feature_flag.id)

  3. moredip commented on Mar 31, 2022

    @moredip
    Member

    Wouldn't we want to standardize an attribute that indicates the evaluated value of the flag?

    feature_flag.evaluated_value, or just feature_flag.flag_value?

  4. justinabrahms commented on Mar 31, 2022

    @justinabrahms
    Member

    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.

  5. moredip commented on Mar 31, 2022

    @moredip
    Member

    The thing I'm missing here is "variant name".

    @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

  6. justinabrahms commented on Mar 31, 2022

    @justinabrahms
    Member

    @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?

  7. moredip commented on Mar 31, 2022

    @moredip
    Member

    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?

  8. justinabrahms commented on Mar 31, 2022

    @justinabrahms
    Member

    @moredip You've got it! I've attempted to document what I've said here: #31

  9. toddbaert commented on Mar 31, 2022

    @toddbaert
    Member

    @justinabrahms I made a similar comment in your recent PR: https://github.com/open-feature/spec/pull/31/files . I'll repeat it here:

    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?

  10. justinabrahms commented on Mar 31, 2022

    @justinabrahms
    Member

    I'll keep the convo on that thread, but interested in solving that. :)

  11. beeme1mr commented on Mar 31, 2022

    @beeme1mr
    MemberAuthor

    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.

  12. beeme1mr commented on Mar 31, 2022

    @beeme1mr
    MemberAuthor

    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.

  13. justinabrahms commented on Mar 31, 2022

    @justinabrahms
    Member

    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.

  14. beeme1mr commented on Apr 1, 2022

    @beeme1mr
    MemberAuthor

    @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?

  15. justinabrahms commented on Apr 1, 2022

    @justinabrahms
    Member

    @beeme1mr super happy with that.

  16. 7 remaining items

  17. toddbaert commented on Apr 5, 2022

    @toddbaert
    Member

    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.

  18. dyladan commented on Apr 5, 2022

    @dyladan
    Contributor

    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

  19. self-assigned this
    on Apr 26, 2022
  20. moved this from Backlog to In Progress in 🛣️ OpenFeature Roadmapon May 24, 2022
  21. added
    roadmap
    on May 26, 2022
  22. changed the title [-]Define Semantic Convention for Feature Flagging[/-] [+]Define OTel Semantic Convention for Feature Flagging[/+] on May 27, 2022
  23. beeme1mr commented on Dec 1, 2022

    @beeme1mr
    MemberAuthor

    Success!

  24. Repository owner moved this from In Progress to Done in 🛣️ OpenFeature Roadmapon Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

architectureroadmapspecification

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions