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

Move the evaluated value from the event body to attributes #1990

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

Conversation

dyladan
Copy link
Member

@dyladan dyladan commented Mar 12, 2025

This came as a result of @trask reviewing the feature flag semconv to move away from body fields to attributes. type is also added because the evaluated value can be any type.

@dyladan dyladan requested review from a team as code owners March 12, 2025 13:42
|---|---|---|
| `boolean` | The `feature_flag.result.value` is a stringified boolean. | ![Development](https://img.shields.io/badge/-development-blue) |
| `number` | The `feature_flag.result.value` is a stringified number. | ![Development](https://img.shields.io/badge/-development-blue) |
| `object` | The `feature_flag.result.value` is a stringified object. | ![Development](https://img.shields.io/badge/-development-blue) |
Copy link
Contributor

Choose a reason for hiding this comment

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

An object may be massive. Should we be worried about size or leave that up to the implementor?

Copy link
Member

Choose a reason for hiding this comment

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

can you mention this in the notes for this attribute? we discussed large attributes in the log/event SIG just yesterday as this is also an issue coming up in GenAI events. we currently want these to (generally) go into event attributes, and are exploring ways to indicate these (potentially) large attributes to pipelines/backends so they can choose alternative storage for them if they want

there's also a case to be made for this to remain in the body if it's going to be large and if it's the central thing reported by the event. e.g. we are still debating whether mobile crash dumps should be reported as an event attribute or event body

Copy link
Member Author

Choose a reason for hiding this comment

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

I can add a note. I think it's not expected that it is often large, but it can be. In that case is attribute still appropriate?

Copy link
Member Author

Choose a reason for hiding this comment

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

if it's going to be large

I think it's only sometimes large

and if it's the central thing reported by the event

The evaluation result is obviously important, but we expect variant (a short name that identifies a result) to be used more often. Some systems don't have a concept of variant though

Copy link
Member Author

Choose a reason for hiding this comment

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

| [`feature_flag.context.id`](/docs/attributes-registry/feature-flag.md) | string | The unique identifier for the flag evaluation context. For example, the targeting key. | `5157782b-2203-4c80-a857-dbbd5e7761db` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`feature_flag.evaluation.error.message`](/docs/attributes-registry/feature-flag.md) | string | A message explaining the nature of an error occurring during flag evaluation. | `Flag `header-color` expected type `string` but found type `number`` | `Recommended` [5] | ![Development](https://img.shields.io/badge/-development-blue) |
| [`feature_flag.evaluation.error.message`](/docs/attributes-registry/feature-flag.md) | string | A message explaining the nature of an error occurring during flag evaluation. | `Flag `header-color` expected type `string` but found type `number`` | `Recommended` [7] | ![Development](https://img.shields.io/badge/-development-blue) |
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the be evaluation or result? It seems odd to me to use result for success and evaluation for failure.

Copy link
Member

Choose a reason for hiding this comment

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

I think this should be (generic) error.message, which we don't have, but I would support.

It's essentially what we put in span status description on spans, but don't have a place today to put on events.

@lmolkova wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

I left it as evaluation because in a failure scenario you might not actually have a result. its the evaluation that fails

Copy link
Member Author

Choose a reason for hiding this comment

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

Created a PR for discussion about generic error.message #1992

Because the evaluated flag value is unstructured and may be any type, it left to the instrumentation author to determine how best to achieve this.
- id: feature_flag.result.type
type:
members:
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm currently missing null which is a valid JSON type but is not a valid attribute. @trask what is generally the protocol here? Should I put anything technically representable? Or should I limit to what is allowed in attribute values?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Awaiting SIG approval
Development

Successfully merging this pull request may close these issues.

3 participants