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

[receiver/hostmetrics] Process scraper fails to read parent-process information for some processes on Windows #14679

Closed
BinaryFissionGames opened this issue Oct 3, 2022 · 9 comments

Comments

@BinaryFissionGames
Copy link
Contributor

BinaryFissionGames commented Oct 3, 2022

What happened?

Description

When using the process scraper on windows, errors are constantly logged, indicating that some processes do not exist.
This ends up filling the logs with the same error repeatedly, which may bury other logs.

Steps to Reproduce

Run the collector as administrator with the process scraper enabled.

Expected Result

No errors are logged.

Actual Result

Error is logged on each scrape.

Collector version

v0.61.0

Environment information

Environment

OS: Windows server 2019

OpenTelemetry Collector configuration

receivers:
  hostmetrics/host__source0:
    collection_interval: 60s
    scrapers:
      filesystem:
      load:
      memory:
      network:
      paging:
      process:
        mute_process_name_error: true

exporters:
  logging:

service:
  pipelines:
    metrics:
      receivers:
        - hostmetrics
      exporters:
        - logging

Log output

{"level":"error","ts":"2022-10-03T18:15:13.347Z","caller":"scraperhelper/scrapercontroller.go:197","msg":"Error scraping metrics","kind":"receiver","name":"hostmetrics/host__source0","pipeline":"metrics","error":"error reading parent pid for process \"csrss.exe\" (pid 388): process does not exist; error reading parent pid for process \"wininit.exe\" (pid 460): process does not exist; error reading parent pid for process \"csrss.exe\" (pid 468): process does not exist; error reading parent pid for process \"winlogon.exe\" (pid 520): process does not exist; error reading parent pid for process \"explorer.exe\" (pid 2516): process does not exist; error reading parent pid for process \"csrss.exe\" (pid 4340): process does not exist; error reading parent pid for process \"winlogon.exe\" (pid 4384): process does not exist","scraper":"process","stacktrace":"go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).scrapeMetricsAndReport\n\tC:/Users/runneradmin/go/pkg/mod/go.opentelemetry.io/collector@v0.61.0/receiver/scraperhelper/scrapercontroller.go:197\ngo.opentelemetry.io/collector/receiver/scraperhelper.(*controller).startScraping.func1\n\tC:/Users/runneradmin/go/pkg/mod/go.opentelemetry.io/collector@v0.61.0/receiver/scraperhelper/scrapercontroller.go:172"}

Additional context

No response

@BinaryFissionGames BinaryFissionGames added bug Something isn't working needs triage New item requiring triage labels Oct 3, 2022
@BinaryFissionGames BinaryFissionGames changed the title [receiver/hostmetrics] Windows fails to read parent-process information for some processes [receiver/hostmetrics] Process scraper fails to read parent-process information for some processes on Windows Oct 3, 2022
@evan-bradley evan-bradley added priority:p2 Medium receiver/hostmetrics and removed needs triage New item requiring triage labels Oct 5, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2022

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

@dmitryax
Copy link
Member

dmitryax commented Oct 5, 2022

@davidmirza408 can it be caused by adding parent id attribute? If so, do you have a chance to take a look?

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2022

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Dec 5, 2022
@JadziaMataj
Copy link
Contributor

This error is still occurring.
I resolved this problem in my own fork. The following is description of my solution.
I suggest to use Ppid() function from gopsutil (which returns parent process pid (int 32, error)) instead of Parent() (which returns Parent Process, error) in the line 137:


I can take care of it.

@JadziaMataj
Copy link
Contributor

@dmitryax what do you think about solution described above?

@dmitryax
Copy link
Member

@JadziaMataj, it sounds good to me if it solves the issue. We don't need the parent object itself. Can you please submit a PR?

@JadziaMataj
Copy link
Contributor

@dmitryax PR is ready to review.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Jul 31, 2023
@github-actions
Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants