-
Notifications
You must be signed in to change notification settings - Fork 58
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
Sort attributes by name, not by source #205
Sort attributes by name, not by source #205
Conversation
I would prefer either using a sensible order in the YAML (alphabetical might or might not be the best, there might be closely related attributes that are best put together or where there is another logical order), or one could argue that this should instead be a lint (error if input is not correctly sorted) |
why though? what's the benefit to someone reading the semconv? For authors, there is always a possibility of rendering individual tables per group of attributes. Having a predictable order also helps to review things. As a reader, I want to be able to skim through the table and find my attribute in certain place, not knowing where author of semconv wanted to put it. |
Definitely. I was under the impression that currently the order is the same as in the YAML? Do we have some random order? |
the order is random since:
either way, the order author had in mind is not obvious to readers, who end up with de-facto randomly ordered attributes |
One more observation: since we have a lot of namespaces now, most attributes are going to be referenced from somewhere and namespaces provide all the reasonable grouping. Later on, we can consider adding sorting by requirement level and whatnot, but current random thing hurts right now during reviews. |
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'm in favor of moving this direction. The simplicity gained is a big win.
semantic-conventions/src/opentelemetry/semconv/model/semantic_convention.py
Outdated
Show resolved
Hide resolved
252575e
to
daeedf8
Compare
semantic-conventions/src/opentelemetry/semconv/model/semantic_convention.py
Outdated
Show resolved
Hide resolved
semantic-conventions/src/opentelemetry/semconv/model/semantic_convention.py
Outdated
Show resolved
Hide resolved
daeedf8
to
1e7f71c
Compare
How attributes are added to semconv is an implementation detail, rendered markdown should not depend on it.
This change sorts attributes in final md table alphabetically.
This would also reduce diffs in semconv and help us review uninteresting changes when hierarchy refactorings cause massive changes because of attributes moving in the table.