open-telemetry / semantic-conventions-java

Java generated classes for semantic conventions
Apache License 2.0
14 stars 17 forks source link

Fix possible collisions when attribute is renamed #72

Open lmolkova opened 3 months ago

lmolkova commented 3 months ago

See https://github.com/open-telemetry/semantic-conventions/issues/1031 for the details

TL;DR:

to_const_name jinja helper generates the same constant name for foo.bar and foo_bar. Tooling will provide a better helper, the workaround for now is to use custom macro

e.g.

{%- macro to_const_name_v2(attribute_name) -%}
{{attribute_name | replace("_", "__") | to_const_name}}
{%- endmacro %}

So that no collision would happen.

We're still collecting input on how a good format would look like