-
Notifications
You must be signed in to change notification settings - Fork 972
Support maps and heterogeneous arrays as attribute values #2888
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
Changes from 3 commits
8c497e3
c0ef00f
c2d2941
1a385e7
b15695c
5e0d081
5ccaaf0
dc31a43
4f5e141
58cbb1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -29,12 +29,23 @@ An `Attribute` is a key-value pair, which MUST have the following properties: | |||||
|
|
||||||
| - The attribute key MUST be a non-`null` and non-empty string. | ||||||
| - Case sensitivity of keys is preserved. Keys that differ in casing are treated as distinct keys. | ||||||
| - The attribute value is either: | ||||||
| - The attribute value can be of `any` type, where any is defined as one of the following: | ||||||
tigrannajaryan marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| - A primitive type: string, boolean, double precision floating point (IEEE 754-1985) or signed 64 bit integer. | ||||||
| - An array of primitive type values. The array MUST be homogeneous, | ||||||
| i.e., it MUST NOT contain values of different types. | ||||||
| - A homogeneous array of values of primitive type [before 1.29.0]. | ||||||
| - An array of `any` values [since 1.29.0]. | ||||||
| - A key/value map, where key is string and value is `any` value. Any form of reference | ||||||
tigrannajaryan marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| loops is disallowed. [since 1.29.0]. | ||||||
tigrannajaryan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| loops is disallowed. [since 1.29.0]. | |
| cycle is MUST NOT be supported. [since 1.29.0]. |
E.g. in .NET the attribute is passed as KeyValuePair<string, object>. Nothing prevents from passing an object which will have a cycle, but the SDK can handle it e.g. by ignoring such attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even when it is possible I am not sure if it would be efficient to check if there is no cycle during "attribute value construction". I think it would be better if the place where attributes are accepted would check if the attributes' values have no cycles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure we need to specify where exactly (which place in code) this check happens. We only describe a valid data model here. How you enforce that data model is a particular SDK's design choice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only describe a valid data model here. How you enforce that data model is a particular SDK's design choice.
I totally agree but the current way it is worded suggests that it should be impossible to pass ("is disallowed") such attributes. This is why a propose to change the wording to "supported". This section does not says anything about the SDK so it can be interpreted that even the API disallows. Also I do not know how to interpret what "disallowed" means from programming perspective.
tigrannajaryan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these are only guidelines for the users (consumers)? If so then I think it will be good to call it out explicitly that these are usage guidelines. Also I do not think it we should use normative wording as we "do not control the user".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for producers and designers of semantic conventions. I am not sure how this can be interpreted to be guidelines for consumers. Consumers don't choose what attribute types to use, they consume what they receive.
Also I do not think it we should use normative wording as we "do not control the user".
We do control Otel semantic conventions and I think we are in the position to make a strong recommendation to producers, even the ones we don't control.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for clarification: By consumers I had in mind "users of the API" 😉 Feel free to resolve the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is guidelines for semantic conventions, we should move it to the semantic conventions repo. We recently moved attribute naming docs from the spec to semantic conventions. It doesn't make sense to have semantic convention advice interspersed in a document describing attributes for SDK implementers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jack-berg The first list item is a guideline for semantic conventions and for anyone who uses the API. Perhaps semantic conventions repo is a better place for it.
I have changed the second list item to MUST NOT, which makes it an API requirement, not a guideline, so it belongs here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for clarification: By consumers I had in mind "users of the API" 😉 Feel free to resolve the comment.
Ah, I misunderstood what you meant :-) Good question in that case.
I think we can do as @jack-berg suggests and move the usage recommendation to semconv and keep the strict API requirement here.
Uh oh!
There was an error while loading. Please reload this page.