-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[receiver/hostmetrics] No viable perflib
package
#38858
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
Comments
Pinging code owners: See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Pinging code owners for receiver/hostmetricsreceiver: @dmitryax @braydonk. See Adding Labels via Comments if you do not have permissions to add labels yourself. For example, comment '/label priority:p2 -needs-triaged' to set the priority and remove the needs-triaged label. |
Draft of vendoring in #38859 |
Pinging @pjanotti for additional Windows expertise here. |
Thanks for the ping @braydonk - I will dig into this tomorrow. |
@braydonk the contrib has a package |
Thanks for the insight @pjanotti |
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR vendors the `perflib` package from the latest commit of [`windows_exporter`](https://github.com/prometheus-community/windows_exporter). Some constants had to be copied from related packages in `windows_exporter` to make it work. Original license attribution to Prometheus Authors under MIT license is included in this copy. <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue #38858 <!--Describe what testing was performed and which tests were added.--> #### Testing Ran tests locally, running integration tests in CI. <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: Sam DeHaan <[email protected]>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR vendors the `perflib` package from the latest commit of [`windows_exporter`](https://github.com/prometheus-community/windows_exporter). Some constants had to be copied from related packages in `windows_exporter` to make it work. Original license attribution to Prometheus Authors under MIT license is included in this copy. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue open-telemetry#38858 <!--Describe what testing was performed and which tests were added.--> #### Testing Ran tests locally, running integration tests in CI. <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: Sam DeHaan <[email protected]>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR vendors the `perflib` package from the latest commit of [`windows_exporter`](https://github.com/prometheus-community/windows_exporter). Some constants had to be copied from related packages in `windows_exporter` to make it work. Original license attribution to Prometheus Authors under MIT license is included in this copy. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue open-telemetry#38858 <!--Describe what testing was performed and which tests were added.--> #### Testing Ran tests locally, running integration tests in CI. <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: Sam DeHaan <[email protected]>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR vendors the `perflib` package from the latest commit of [`windows_exporter`](https://github.com/prometheus-community/windows_exporter). Some constants had to be copied from related packages in `windows_exporter` to make it work. Original license attribution to Prometheus Authors under MIT license is included in this copy. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue open-telemetry#38858 <!--Describe what testing was performed and which tests were added.--> #### Testing Ran tests locally, running integration tests in CI. <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: Sam DeHaan <[email protected]>
Adding tests collecting the actual Windows performance counters for scrapers using `internal/perfcounters`. The intent of these tests is to facilitate the migration from the vendored code of `internal/perfcounters` to the existing implementation in `github.com/open-telemetry/opentelemetry-collector-contrib/pkg/winperfcounters`, see #38858 (comment) for details.
Adding public methods that allow to retrieve the raw values of Windows performance counters. This is needed to allow removal of the vendored code under `receiver/hostmetricsreceiver/internal/perfcounters/` used only by that component. This vendored code retrieves raw values of counters instead of calculated ones, e.g.: it doesn't retrieve rate, but the actual values used to calculate the rate of a counter. See #38858 (comment) for details.
…etry#39690) Adding tests collecting the actual Windows performance counters for scrapers using `internal/perfcounters`. The intent of these tests is to facilitate the migration from the vendored code of `internal/perfcounters` to the existing implementation in `github.com/open-telemetry/opentelemetry-collector-contrib/pkg/winperfcounters`, see open-telemetry#38858 (comment) for details.
…try#39835) Adding public methods that allow to retrieve the raw values of Windows performance counters. This is needed to allow removal of the vendored code under `receiver/hostmetricsreceiver/internal/perfcounters/` used only by that component. This vendored code retrieves raw values of counters instead of calculated ones, e.g.: it doesn't retrieve rate, but the actual values used to calculate the rate of a counter. See open-telemetry#38858 (comment) for details.
…try#39835) Adding public methods that allow to retrieve the raw values of Windows performance counters. This is needed to allow removal of the vendored code under `receiver/hostmetricsreceiver/internal/perfcounters/` used only by that component. This vendored code retrieves raw values of counters instead of calculated ones, e.g.: it doesn't retrieve rate, but the actual values used to calculate the rate of a counter. See open-telemetry#38858 (comment) for details.
…try#39835) Adding public methods that allow to retrieve the raw values of Windows performance counters. This is needed to allow removal of the vendored code under `receiver/hostmetricsreceiver/internal/perfcounters/` used only by that component. This vendored code retrieves raw values of counters instead of calculated ones, e.g.: it doesn't retrieve rate, but the actual values used to calculate the rate of a counter. See open-telemetry#38858 (comment) for details.
…ers (open-telemetry#39916) Completes the migration to `pkg/winperfcounters` and removes the vendored third party package, see open-telemetry#38858 (comment) for details.. Previous related changes: - open-telemetry#39690 - open-telemetry#39835 Fixes open-telemetry#38858 Memory and CPU usage by the collector went collect these metrics were not affected by this change, verified manually running the collector on Windows.
Component(s)
receiver/hostmetrics
What happened?
Description
The
perflib
package that was used to create the perfcounter scraper went unmaintained some time ago.In #33653 we updated to use a copy of the library in
windows_exporter
. However, inv0.30.0
this package was removed (moved to internal).As such, we no longer have a viable maintained upstream package that provides
perflib_exporter
's original functionality for raw-querying Windows performance counters.The way I see it, there are two options:
perflib
ourselves, since we rely on it and there is no longer a maintained upstream alternativeperflib
does with our own codewindows_exporter
maintainers make the perflib package non-internal so we can import it. This is in essence asking them to provide a level of maintenance they may not be interested in, given the effort to remove/internalize the package in the newwindows_exporter
versionIt is possible that what the
perfcounters
package does can be done in a different way than whatperflib
does, but I simply don't have the Windows expertise to make that judgement. In the short term, I am inclined toward Option 1.Collector version
v0.122.0
Environment information
N/A
OpenTelemetry Collector configuration
N/A
Log output
Additional context
No response
The text was updated successfully, but these errors were encountered: