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

Error reading Windows processes when filtering is applied #30359

Closed
carlosli888 opened this issue Jan 9, 2024 · 3 comments
Closed

Error reading Windows processes when filtering is applied #30359

carlosli888 opened this issue Jan 9, 2024 · 3 comments
Labels
question Further information is requested receiver/hostmetrics

Comments

@carlosli888
Copy link

Describe the bug
Errors are encountered when collector tries to scrape metrics if a filter is configured for processes in Windows.

Steps to reproduce

  1. Use the following configuration for the hostmetrics receiver:
  hostmetrics:
    scrapers:
      process:
        include:
          names: "Notepad.exe"
          match_type: strict
  1. Start the open telemetry collector using admin account.

What did you expect to see?
No errors or warning.

What did you see instead?
2024-01-08T16:07:23.951-0800 error scraperhelper/scrapercontroller.go:200 Error scraping metrics {"kind": "receiver", "name": "hostmetrics", "data_type": "metrics", "error": "error reading process executable for pid 0: The parameter is incorrect.; error reading process name for pid 0: executable path is empty; error reading process executable for pid 4: A device attached to the system is not functioning.; error reading process name for pid 4: executable path is empty; error reading process executable for pid 72: A device attached to the system is not functioning.; error reading process name for pid 72: executable path is empty; error reading process executable for pid 132: A device attached to the system is not functioning.; error reading process name for pid 132: executable path is empty; error reading process executable for pid 4400: A device attached to the system is not functioning.; error reading process name for pid 4400: executable path is empty; error reading process executable for pid 13488: A device attached to the system is not functioning.; error reading process name for pid 13488: executable path is empty", "scraper": "process"}
go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).scrapeMetricsAndReport
go.opentelemetry.io/collector/receiver@v0.91.0/scraperhelper/scrapercontroller.go:200
go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).startScraping.func1
go.opentelemetry.io/collector/receiver@v0.91.0/scraperhelper/scrapercontroller.go:172

What version did you use?
otelcol-contrib version 0.91.0

What config did you use?

receivers:
  hostmetrics:
    scrapers:
      process:
        include:
          names: "Notepad.exe"
          match_type: strict
...

Environment
OS: Windows 10 Pro

Additional context
Error does not exist if I remove the include section (i.e., do not filter for any process) of the process scraper.

@carlosli888 carlosli888 added the bug Something isn't working label Jan 9, 2024
@mx-psi mx-psi transferred this issue from open-telemetry/opentelemetry-collector Jan 9, 2024
Copy link
Contributor

github-actions bot commented Jan 9, 2024

Pinging code owners for receiver/hostmetrics: @dmitryax @braydonk. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1 crobert-1 added the needs triage New item requiring triage label Jan 9, 2024
@crobert-1
Copy link
Member

Many of the error messages you're seeing are pretty normal and to be expected, as some processes may not be able to be read for metrics.

You can mute these errors using the mute_ configuration options described here. I noticed when I removed the include statement I was still getting errors.

Did you have other comments or concerns in addition to these error messages? Are you able to get the metrics you're looking for from the Notepad.exe process?

@crobert-1 crobert-1 added question Further information is requested and removed bug Something isn't working needs triage New item requiring triage labels Jan 9, 2024
@carlosli888
Copy link
Author

Thank you. I am able to get the metrics. I am following the suggestion to mute these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested receiver/hostmetrics
Projects
None yet
Development

No branches or pull requests

3 participants