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

[cmd/mdatagen] Fix optional metrics support #7166

Merged

Conversation

dmitryax
Copy link
Member

@dmitryax dmitryax commented Jan 13, 2022

Metrics defined with enabled: false flag in metadata.yaml supposed to be optional and not reported by metrics builder by default. There is a bug in metadata.yaml validation which doesn't allow zero value in Enabled field. This change fixes the bug by switching the Enabled field to a pointer type to keep the field required metadata.yaml but not enforce a non-zero value.

Link to tracking Issue: open-telemetry/opentelemetry-collector#10904

@dmitryax dmitryax force-pushed the mdatagen-fix-enabled-metrics-field branch from 787948b to 27c32b1 Compare January 14, 2022 20:13
Metrics defined with `enabled: false` flag in metadata.yaml supposed to be optional and not reported by metrics builder by default. There is a bug in metadata.yaml validation which doesn't allow zero value in Enabled field. This change fixes the bug by switching the Enabled field to a pointer type to keep the field required metadata.yaml but not enforce a non-zero value.
@dmitryax dmitryax force-pushed the mdatagen-fix-enabled-metrics-field branch from 27c32b1 to 8ed8b8b Compare January 17, 2022 04:54
@dmitryax dmitryax added the ready to merge Code review completed; ready to merge by maintainers label Jan 17, 2022
@jpkrohling jpkrohling merged commit 9c593ae into open-telemetry:main Jan 17, 2022
animetauren pushed a commit to animetauren/opentelemetry-collector-contrib that referenced this pull request Apr 4, 2023
…etry#7166)

It wasn't picked up because of the `.yml` (not `.yaml`) extension.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants