Skip to content
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

Consistently format semantic convention enums #1519

Closed
rakyll opened this issue Mar 9, 2021 · 2 comments · Fixed by #1598 or #1863
Closed

Consistently format semantic convention enums #1519

rakyll opened this issue Mar 9, 2021 · 2 comments · Fixed by #1598 or #1863
Labels
spec:miscellaneous For issues that don't match any other spec label

Comments

@rakyll
Copy link
Contributor

rakyll commented Mar 9, 2021

Semantic convention enums currently have inconsistent formatting. For example, os.type values are all capital (https://github.com/open-telemetry/opentelemetry-specification/blob/main/semantic_conventions/resource/os.yaml#L10) whereas cloud.infrastructure_service values are underscored lowercase (https://github.com/open-telemetry/opentelemetry-specification/blob/main/semantic_conventions/resource/cloud.yaml#L45).

With the new requirement of autogenerating the semantic conventions, formatting in the YAML files is important for the code generator developers. Bless a format and consistently use it everywhere.

@rakyll rakyll added the spec:miscellaneous For issues that don't match any other spec label label Mar 9, 2021
@rakyll
Copy link
Contributor Author

rakyll commented Mar 10, 2021

We decided to take the next steps to provide some consistency here in the SIG meeting. Each language has their own idiomatic way to define constants.

Given the different capitalization rules, it's important to be able to have a delimiter for keys that contains more than one word. I propose us to use all lower case with "_" and rely on autogenerators to produce idiomatic constant identifiers.

For example, "infrastructure_service" can be autogenerated to:

kInfrastructureService
INFRASTRUCTURE_SERVICE
infrastructureService
infrastructure_service

carlosalberto pushed a commit that referenced this issue Apr 15, 2021
* Have consistent formatting for semantic convention enums

Currently, semantic convention enum values are not consistent.
For example, os.type values are all capitals whereas
cloud.infrastructure_service values are underscored lowercase.
This change improves the inconsistencies.

We also expect language implementations to autogenerate code
from enum values. Each language has their own conventions for
constant variable identifiers and we expect the consistent
formatting is going to help the language implementors.

Fixes #1519.
@Oberon00
Copy link
Member

Oberon00 commented Aug 11, 2021

I'm reopening this, since we have this problem again now. See open-telemetry/build-tools#59. Evidently, we also need to enforce this with our tooling somehow (out of scope for this issue).

@Oberon00 Oberon00 reopened this Aug 11, 2021
Oberon00 added a commit to dynatrace-oss-contrib/opentelemetry-specification that referenced this issue Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec:miscellaneous For issues that don't match any other spec label
Projects
None yet
2 participants