open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.01k stars 2.33k forks source link

[receiver/hostmetrics] (Filesystems Scraper) Folder mounted volumes under windows are not reported #27203

Open dloucasfx opened 1 year ago

dloucasfx commented 1 year ago

Component(s)

receiver/hostmetrics

What happened?

Description

The filesystem scraper uses GoPsutil lib to get the windows partitions/volumes stats; However, it only fetches letter mounted volumes https://github.com/shirou/gopsutil/blame/v3.23.8/disk/disk_windows.go#L108 If user mounted a volume to a path, the scraper will not get any metrics for that volumes

Steps to Reproduce

Run the collector with this simple config

extensions:
  health_check:
    endpoint: 0.0.0.0:13133

receivers:
  hostmetrics:
    collection_interval: 10s
    scrapers:
      filesystem:

processors:
  batch:

  resourcedetection:
    detectors: [azure, system]
    override: false

  resourcedetection/internal:
    detectors: [system]
    override: true
    system:
      hostname_sources: [dns]

exporters:
  logging:
    loglevel: debug
  file:
    path: C:\logs

service:
  telemetry:
    logs:
      level: "info"
  extensions: [health_check]
  pipelines:
    metrics:
      receivers: [hostmetrics]
      processors: [batch, resourcedetection]
      exporters: [file]

Expected Result

The folder mounted volume is not present in the metrics

Actual Result

The folder mounted volume should be present in the collected metrics

Proposed Solution

We ran into this issue in the Signalfx agent and we implemented this https://github.com/signalfx/signalfx-agent/blob/main/pkg/monitors/filesystems/partitions_windows.go to address the issue as GoPSutil has not addressed the issue https://github.com/shirou/gopsutil/issues/1245

Happy to move the SA implementation to here while waiting on gopsutil to fix it.

Collector version

main

github-actions[bot] commented 1 year ago

Pinging code owners:

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

dmitryax commented 1 year ago

Sounds good to me. I think we should try to push the fix in gopsutil before porting the SA implementation

dloucasfx commented 1 year ago

Pushed the fix to gopsutil https://github.com/shirou/gopsutil/pull/1534

github-actions[bot] commented 10 months ago

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.

braydonk commented 10 months ago

Keeping open since there's a PR open for this in gopsutil.

github-actions[bot] commented 8 months ago

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[bot] commented 6 months ago

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[bot] commented 4 months ago

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.