-
Notifications
You must be signed in to change notification settings - Fork 2.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
[receiver/windowsperfcounters] fix: Drop metrics with empty datapoints. #32384
[receiver/windowsperfcounters] fix: Drop metrics with empty datapoints. #32384
Conversation
Added a unit test for empty data points and ran it:
With Fix:
I also found out that the tests didn't actually validate any of the data fixtures (so essentially they weren't testing much). I took the opportunity to fix that as well. |
receiver/windowsperfcountersreceiver/windowsperfcounters_scraper_test.go
Show resolved
Hide resolved
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.
Please rebase to include #32518
44e3896
to
ac3d4ae
Compare
76d09ba
to
0b14085
Compare
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Description: When scraping Windows Performance Counters, it's possible that some counter objects do not exist. When that is the case,
windowsperfcounters
will still create theMetric
object with no datapoints in it. Some exporters throw errors when encountering this. The fix proposed in this PR does an extra pass after all metrics have been scraped and removes theMetric
objects for which no datapoints were scraped.Link to tracking Issue: #4972
Testing:
debug
exporter seesResourceMetrics
with no metrics and doesn't throw.prometheusremotewrite
exporter no longer complains about empty datapoints and that it skips the export when no metrics are availableNo unit tests added for now. I will add a unit test once I have confirmation that this is the right way to remove empty datapointsUnit test covering the changes and enabling fixture validation which was not implemented.Documentation: