Skip to content
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

Add value_type to feature flag event #1689

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

dyladan
Copy link
Member

@dyladan dyladan commented Dec 16, 2024

This adds a value_type which references the body field value in feature flag evaluation events. The value field has an undefined type, allowing any type to be included. This means processing pipelines have to sniff the type before applying any logic. In some cases this may even result in ambiguous cases. For example if a processing pipeline stringifies the value, it may be impossible to tell the difference between boolean false and string "false".

@dyladan dyladan requested review from a team as code owners December 16, 2024 21:38
@toddbaert
Copy link

Non-binding approval from me ✔️


---

`feature_flag.evaluation.value.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not for this PR, but we're seriously considering allowing complex attribute types instead of body

#1669 open-telemetry/opentelemetry-specification#4334.

Wonder what your thoughts are

@lmolkova
Copy link
Contributor

@dyladan could you please elaborate on

This means processing pipelines have to sniff the type before applying any logic.

the type information is a part of OTLP (e.g. here's a map attribute json example)

{
  "key": "map.attribute",
  "value": {
    "kvlistValue": {  # type info
      "values": [
        {
          "key": "some.map.key",
          "value": {
            "stringValue": "some value"   # type info in stringValue
          }
        }
      ]
    }
  }

body should be represented in the same way. So I wonder why is it a problem for the pipeline - it should know the type, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants