-
Notifications
You must be signed in to change notification settings - Fork 893
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
[Common] Spec inconsistency with proto definition of Attributes #2581
Comments
This is intentional. Maybe we should add a note in the spec about this? |
As the protocol supports nested attributes, what is wrong with expanding "all" Attributes definition to support nested attributes. This would also allow for unifying attributes usage across the board and usage, especially in relation to the forthcoming EventsApi, which could allow for have a single API for both logs and trace transport mechanisms |
@MSNev can you list some pros and cons of JSON.stringify'ing those nested objects as strings? |
JSON.stringify() is not the specific driver for this spec issue. The issue is that the definitions are not consistent which means an Attribute is not always the same Attribute. We should be treating all definitions of Attribute (supporting nested Attributes) as the same. And as protobuf is defined as supporting nested Attributes then this is "just" as spec issue (on the assumption that SDK's don't have this coded this way, but this should not cause any breaking changes as it's expanding the options. The only potential issues will be for exporters that don't support nesting and that can be resolved by the specific exporter to flatten the attribute keys. JSON.stringify() Side Note (for completeness) |
As @Oberon00 mentioned, this is intentional. OTLP is at least as expressive as the Otel spec, but necessarily exactly as expressive as the spec. We allow OTLP to be more expressive because Otel API/SDK is not the only source of data that we want to represent in OTLP. Other data sources may require richer capabilities that OTLP does offer, in particular the ability to represent arbitrarily nested objects.
This definition of "Attributes" currently applies to traces and metrics only, i.e. to the Stable parts of the spec. It does NOT apply to experimental logs, which has its own definition of what an attributes are and which allows nested objects.
This can be discussed separately. In the past there were objections to allowing this for traces and metrics. So, in short the existing differences between traces/metrics and logs and between the spec and OTLP are known and intentional. |
if LogRecord allows objects/key-value pairs for attribute values, then that is sufficient to address the requirements of RUM. @MSNev? |
@tigrannajaryan That is where the inconsistencies are as the Spec also states here
From offline discussions, this section is also unclear as I read "Collection" as nested Attributes Map<> (coming from the protobuf def) vs as a single flat Array/List of Attributes. @scheler While I found this as part of investigating the possibilities for the EventsAPI, this inconsistency is not specific to the RUM requirements. For Example the JS Sdk, supports nested objects as per the "Attribute Collections" definition. |
This was discussed numerous times. Nested attributes make it harder for backends to process (search, store, ...) them. Issue #376 is still open in fact, I think this is where this discussion belongs. (The issue also has two associated PRs with more discussion) Leaving this open to track the inconsistency mentioned by @MSNev. But please continue discussion about whether nested attributes should be allowed for traces/metrics/resources (they are not now) to #376. |
…telemetry#2581 and Support map values and nested values for attributes open-telemetry#376
…telemetry#2581 and Support map values and nested values for attributes open-telemetry#376
…telemetry#2581 and Support map values and nested values for attributes open-telemetry#376
…telemetry#2581 and Support map values and nested values for attributes open-telemetry#376
…telemetry#2581 and Support map values and nested values for attributes open-telemetry#376
…telemetry#2581 and Support map values and nested values for attributes open-telemetry#376
…telemetry#2581 and Support map values and nested values for attributes open-telemetry#376
…telemetry#2581 and Support map values and nested values for attributes open-telemetry#376
…telemetry#2581 and Support map values and nested values for attributes open-telemetry#376
…telemetry#2581 and Support map values and nested values for attributes open-telemetry#376
…telemetry#2581 and Support map values and nested values for attributes open-telemetry#376
…telemetry#2581 and Support map values and nested values for attributes open-telemetry#376
The proto definition used for attributes uses "KeyValue" which can have a value of AnyValue, however, the spec definition of "Attribute" only allows for primitives or an Array of primitives, this is inconsistent.
What did you expect to see?
Additional context.
The Spec Attribute definition
Trace proto attribute definition
And the Logs spec also uses Attributes
Logs proto attribute definition
With Proto KeyValue defined as taking AnyValue
And Proto AnyValue being
And Proto KeyValueList being
The text was updated successfully, but these errors were encountered: