Support more attribute value types #3731
Replies: 1 comment 7 replies
-
On the objects / arrays of objects front, that is supported at the protocol level but not in the APIs / SDKs (with the exception of logs). #2888 tried to extend API / SDK support generally, but wasn't merged. I would comment on that PR or the #376 issue. I'm not sure about the use case for null or none. My gut reaction is that null / none is trivially different from using boolean with false. Maybe you can open an issue and expand on the use case? I haven't come across anyone ask for integers larger than 64 bits, but I definitely understand the use case. I recommend opening an issue for that as well. As a workaround, and assuming you can coordinate with the OTLP server, you could encode the large integer as a string? Obviously not great. |
Beta Was this translation helpful? Give feedback.
-
The allowed values in attributes seem to contain some notable omissions:
I understand that the recommendation for objects is to "flatten" them to
foo.bar
instead of something like{"foo": {"bar": ...}}
but that doesn't mesh well with arrays, i.e. I don't think{"foo": [{"bar": ...}]}
or just[{"foo": ...}]
can be represented cleanly.As far as I know there is no way to put a null/none value in attributes since the only types are integers, strings, bytes, floats and lists of these.
I ran into the limited size integers problem when I tried to stick a python integer into attributes.
I understand that most of these limitations come from protobuf encoding itself, but it seems to me like otel should be able to work around this and not let the most common (but not only!) encoding leak into the specification. For example, we could automatically take large integers and encode them as bytes then have SDK functions to encode/decode from protobuf into language structs that take this into account and automatically unpack into large integers / variable sized integers for each language. Null values could similarly be handled by having a null field on the
AnyValue
model that is a boolean or something like that.Most of this should be backwards compatible to implement (given that these things are totally unsupported / error right now).
Beta Was this translation helpful? Give feedback.
All reactions