open-telemetry / semantic-conventions-java

Java generated classes for semantic conventions
Apache License 2.0
15 stars 19 forks source link

Semconv codegen should produce different constant names if attribute is renamed _ -> `` #75

Closed lmolkova closed 3 months ago

lmolkova commented 4 months ago

Code generator generates the same attribute name constant for attribute.name and attribute_name. As a result, if attribute is renamed (_ is changed to . or vice versa), the value of attribute changes, but the name stays the same.

It's ambiguous - see https://github.com/open-telemetry/semantic-conventions/issues/1031 and https://github.com/open-telemetry/semantic-conventions/issues/1118 for the discussion.

Based on https://github.com/open-telemetry/semantic-conventions/issues/1118, the semconv recommendation would be to:

This PR demonstrates the result of such naming policy change.