diff --git a/semantic-conventions/src/opentelemetry/semconv/main.py b/semantic-conventions/src/opentelemetry/semconv/main.py index d3b84ee1..6d792e0e 100644 --- a/semantic-conventions/src/opentelemetry/semconv/main.py +++ b/semantic-conventions/src/opentelemetry/semconv/main.py @@ -108,10 +108,11 @@ def check_compatibility(semconv, args, parser): compatibility_checker = CompatibilityChecker(semconv, prev_semconv) problems = compatibility_checker.check() - if problems: + if any(problems): print(f"Found {len(problems)} compatibility issues:") - for problem in problems: - print(f"\t {problem}") + problems_str = [str(p) for p in problems] + for problem in sorted(problems_str): + print(f"\t{problem}") if not args.ignore_warnings or ( args.ignore_warnings and any(problem.critical for problem in problems) diff --git a/semantic-conventions/src/opentelemetry/semconv/templating/compatibility.py b/semantic-conventions/src/opentelemetry/semconv/templating/compatibility.py index f5ea0bb3..d1d4ee45 100644 --- a/semantic-conventions/src/opentelemetry/semconv/templating/compatibility.py +++ b/semantic-conventions/src/opentelemetry/semconv/templating/compatibility.py @@ -24,7 +24,7 @@ def __init__(self, signal: str, name: str, message: str, critical: bool = True): self.critical = critical def __str__(self): - return f"\t {self.signal} '{self.name}': {self.message}" + return f"{self.signal} '{self.name}' {self.message}" def __eq__(self, other): if isinstance(other, self.__class__):