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

[Metric builder] Replace enum attributes values with typed constants #9683

Merged
merged 2 commits into from
May 4, 2022

Conversation

dmitryax
Copy link
Member

@dmitryax dmitryax commented May 2, 2022

Record...DataPoint functions should take one of predefined attribute values instead of any string if the attribute has enum field defined in metadata.yaml. This significantly reduces chance of passing wrong attribute values and helps to ensure accuracy of the automatically generated documentation.

Resolves #9595

This PR includes changes from #9688 which should be merged first to avoid introducing any functional changes here

@dmitryax dmitryax requested a review from a team May 2, 2022 20:50
@dmitryax dmitryax marked this pull request as draft May 2, 2022 20:56
@dmitryax dmitryax force-pushed the typed-attribute-values branch 2 times, most recently from 6f5cd94 to 9f521dd Compare May 2, 2022 21:48
@dmitryax dmitryax marked this pull request as ready for review May 2, 2022 22:43
@djaglowski
Copy link
Member

@dmitryax, #9688 has been merged

`Record...DataPoint` functions should take one of predefined attribute values instead of any string if the attribute has enum field defined in metadata.yaml. This significantly reduces chance of passing wrong attribute values and helps to ensure accuracy of the automatically generated documentation.
@dmitryax
Copy link
Member Author

dmitryax commented May 3, 2022

@djaglowski rebased. PTAL

Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement

@djaglowski
Copy link
Member

Load test failures are unrelated to this PR

@djaglowski djaglowski merged commit 99d2204 into open-telemetry:main May 4, 2022
djaglowski pushed a commit to djaglowski/opentelemetry-collector-contrib that referenced this pull request May 10, 2022
…pen-telemetry#9683)

`Record...DataPoint` functions should take one of predefined attribute values instead of any string if the attribute has enum field defined in metadata.yaml. This significantly reduces chance of passing wrong attribute values and helps to ensure accuracy of the automatically generated documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Metric builder] Replace attributes value enums with typed constants
3 participants