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] Error while fetching partitions on Windows invalidates receiving file system information #14315

Closed
atoulme opened this issue Sep 19, 2022 · 2 comments
Labels
bug Something isn't working priority:p2 Medium receiver/hostmetrics

Comments

@atoulme
Copy link
Contributor

atoulme commented Sep 19, 2022

What happened?

Description

The hostmetrics-> filesystems scraper is failing with this error

1.6615175914398837e+09	error	scraperhelper/scrapercontroller.go:197	Error scraping metrics	{"kind": "receiver", "name": "hostmetrics", "pipeline": "metrics", "error": "This drive is locked by BitLocker Drive Encryption. You must unlock this drive from Control Panel.", "scraper": "filesystem"}
go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).scrapeMetricsAndReport
	/builds/o11y-gdi/splunk-otel-collector-releaser/.go/pkg/mod/go.opentelemetry.io/collector@v0.58.0/receiver/scraperhelper/scrapercontroller.go:197
go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).startScraping.func1
	/builds/o11y-gdi/splunk-otel-collector-releaser/.go/pkg/mod/go.opentelemetry.io/collector@v0.58.0/receiver/scraperhelper/scrapercontroller.go:172

We do not care about metrics for this locked drive, but this error is preventing other drives from getting scraped.

The error is thrown when we tried to get the list of partitions at https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/filesystem_scraper.go#L80.

User tried to exclude the driver, but the problem is that those filters are applied after we get the partitions https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/filesystem_scraper.go#L88.

The PartitionsWithContextfunc on windows gopsutil/disk_windows.go stops on error and returns the list of partitions already collected and an error; so even if our scraper processed the partitions that are already collected and ignored the error, there is no guarantee that we’ll cover all partitions.

I have opened shirou/gopsutil#1347 to fix the issue from gopsutil.

Steps to Reproduce

  • Set up a Windows machine
  • Lock a drive
  • Use the hostmetrics receiver with this machine

Expected Result

  • All readable partitions should report in

Actual Result

  • No partitions are reporting.

Collector version

0.59.0

Environment information

Environment

OS: Windows

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@github-actions
Copy link
Contributor

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

@atoulme
Copy link
Contributor Author

atoulme commented Nov 3, 2022

The behavior of the collector, coupled with the new release of gopsutil, should now fix the issue. I will mark this closed and I look forward to the next release of the collector.

@atoulme atoulme closed this as completed Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:p2 Medium receiver/hostmetrics
Projects
None yet
Development

No branches or pull requests

3 participants