Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Support maps and heterogeneous arrays as attribute values #2888
Support maps and heterogeneous arrays as attribute values #2888
Changes from 3 commits
8c497e3
c0ef00f
c2d2941
1a385e7
b15695c
5e0d081
5ccaaf0
dc31a43
4f5e141
58cbb1a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 if will be possible to disallow it in all languages (e.g. Python).
Maybe we should say something
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.
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.
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.
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.
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.