[receiver/windowsperfcounters] fix: Drop metrics with empty datapoints.#32384
Merged
dmitryax merged 14 commits intoJul 15, 2024
Merged
Conversation
codeboten
reviewed
Apr 17, 2024
Contributor
Member
Author
|
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. |
alxbl
commented
Apr 18, 2024
alxbl
commented
Apr 18, 2024
6 tasks
44e3896 to
ac3d4ae
Compare
76d09ba to
0b14085
Compare
Contributor
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Contributor
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
pjanotti
approved these changes
Jun 24, 2024
dmitryax
reviewed
Jul 2, 2024
atoulme
approved these changes
Jul 15, 2024
crobert-1
approved these changes
Jul 15, 2024
dmitryax
approved these changes
Jul 15, 2024
pjanotti
added a commit
to pjanotti/opentelemetry-service-contrib
that referenced
this pull request
Jul 16, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description: When scraping Windows Performance Counters, it's possible that some counter objects do not exist. When that is the case,
windowsperfcounterswill still create theMetricobject 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 theMetricobjects for which no datapoints were scraped.Link to tracking Issue: #4972
Testing:
debugexporter seesResourceMetricswith no metrics and doesn't throw.prometheusremotewriteexporter 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: