Skip to content

Commit

Permalink
Sort attribute tables by requirement level and attribute name
Browse files Browse the repository at this point in the history
  • Loading branch information
pyohannes committed Feb 6, 2024
1 parent f8b934b commit c4d6f10
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from opentelemetry.semconv.model.exceptions import ValidationError
from opentelemetry.semconv.model.semantic_attribute import (
AttributeType,
RequirementLevel,
SemanticAttribute,
)
from opentelemetry.semconv.model.unit_member import UnitMember
Expand Down Expand Up @@ -131,7 +132,7 @@ def _get_attributes(self, templates: Optional[bool]):
if templates is None
or templates == AttributeType.is_template_type(attr.attr_type)
],
key=lambda attr: attr.fqn,
key=lambda attr: (attr.requirement_level.value if attr.requirement_level else RequirementLevel.OPT_IN.value, attr.fqn),
)

def __init__(self, group):
Expand Down

0 comments on commit c4d6f10

Please sign in to comment.