-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[mdatagen] mdatagen support validate metrics in in telemetry section #10942
[mdatagen] mdatagen support validate metrics in in telemetry section #10942
Conversation
} | ||
errs = errors.Join(errs, md.validateAttributes(usedAttrs)) | ||
errs = errors.Join(errs, validateMetrics(md.Metrics, md.Attributes, usedAttrs), | ||
validateMetrics(md.Telemetry.Metrics, md.Attributes, usedAttrs), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Frapschen, is there already a unit test that covers this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please see the changed file cmd/mdatagen/testdata/unused_attribute.yaml
, it will make sure the attributes that are used in telemetry.metric
will not encounter unused attributes: [xxx]
error.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10942 +/- ##
==========================================
- Coverage 92.21% 92.19% -0.03%
==========================================
Files 405 405
Lines 19240 19245 +5
==========================================
Hits 17743 17743
- Misses 1130 1133 +3
- Partials 367 369 +2 ☔ View full report in Codecov by Sentry. |
Hi @codeboten, PTAL thanks! |
@codeboten just a friendly ping. Please review again. |
Description
I have a use case, I define an attribute and try to use it in
telemetry.metric
however I encounter an error:unused attributes: [xxx]
So, I push this PR to enhance the
validateMetrics()
func to support validate metrics intelemetry.metric
Link to tracking issue fix #10925
Fixes #
Testing
Documentation