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

opentelemetry::logs::AnyValue is missing a None variant #1253

Open
FSMaxB opened this issue Sep 7, 2023 · 9 comments
Open

opentelemetry::logs::AnyValue is missing a None variant #1253

FSMaxB opened this issue Sep 7, 2023 · 9 comments
Labels
A-log Area: Issues related to logs S-blocked-spec Status: Blocked on open or unresolved spec triage:accepted Has been triaged and accepted.

Comments

@FSMaxB
Copy link
Contributor

FSMaxB commented Sep 7, 2023

According to https://opentelemetry.io/docs/specs/otel/common/attribute-type-mapping/:

If the source data has no type associated with it and is empty, null, nil or otherwise indicates absence of data it SHOULD be converted to an empty AnyValue, where all the fields are unset.

This is currently unrepresentable with opentelemetry::logs::AnyValue, I suggest adding a new None variant and serializing that accordingly.

@djc
Copy link
Contributor

djc commented Sep 7, 2023

Makes sense -- are you able to submit a PR? Seems like a straightforward addition.

@FSMaxB
Copy link
Contributor Author

FSMaxB commented Sep 7, 2023

I can probably submit a PR within next week. Feel free to ping me again if it hasn't happened by then.

@TommyCpp TommyCpp added A-log Area: Issues related to logs triage:accepted Has been triaged and accepted. labels Sep 10, 2023
@FSMaxB
Copy link
Contributor Author

FSMaxB commented Sep 13, 2023

Is there any reason why both opentelemetry::Value and opentelemetry::logs::AnyValue exist btw.? It seems to me that they should be the same type. (at least according to protocol buffers, they are the same type)

@djc
Copy link
Contributor

djc commented Sep 13, 2023

@lalith @vibhavp can we remove logs::AnyValue in favor of the normal Value?

@lalitb
Copy link
Member

lalitb commented Sep 13, 2023

As per the log data model - the attribute value can be an array of Any values i,e can have heterogenous values. While the Span attributes can only have an array of homogenous primitive values. This was the reason to keep them separate. I guess the proto uses AnyValue::ArrayValue which can be used to store either of these types of values.

@FSMaxB
Copy link
Contributor Author

FSMaxB commented Sep 13, 2023

Ok, this also answers the next question I had, which is whether I should add None to Value as well, the answer is no:

Attribute values of null are not valid and attempting to set a null value is undefined behavior.

@hdost
Copy link
Contributor

hdost commented Feb 21, 2024

Is this related? open-telemetry/opentelemetry-specification#3826

@pellared
Copy link
Member

I think it is related to this one: open-telemetry/opentelemetry-specification#3853

@hdost hdost added the S-blocked-spec Status: Blocked on open or unresolved spec label Feb 21, 2024
@cijothomas
Copy link
Member

@lalitb Can you check if this is required for stabilizing Logs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-log Area: Issues related to logs S-blocked-spec Status: Blocked on open or unresolved spec triage:accepted Has been triaged and accepted.
Projects
None yet
Development

No branches or pull requests

7 participants