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

OpenTelemetry Collector: Filesystem Metrics Showing Zero Values #34934

Open
vimalraj3 opened this issue Aug 30, 2024 · 4 comments
Open

OpenTelemetry Collector: Filesystem Metrics Showing Zero Values #34934

vimalraj3 opened this issue Aug 30, 2024 · 4 comments

Comments

@vimalraj3
Copy link

Component(s)

receiver/hostmetrics

What happened?

Description

The filesystem scraper within the hostmetrics receiver reports zero values for all filesystem-related metrics. This behavior is unexpected, as the underlying filesystem is not empty, and there are active inodes and space utilization.

Steps to Reproduce

  1. Configure the OpenTelemetry Collector with the hostmetrics receiver to include the filesystem scraper.
  2. Run the collector.
  3. Observe the metrics output for the filesystem metrics.

Expected Result

The system.filesystem.usage, system.filesystem.utilization, and system.filesystem.inodes.usage metrics should reflect the actual usage and inodes status of the filesystem, showing non-zero values corresponding to the filesystem’s state.

Actual Result

The metrics consistently show zero values for the following:
• system.filesystem.inodes.usage
• system.filesystem.usage
• system.filesystem.utilization

otel-collector-1  | system.filesystem.inodes.usage{device=/dev/sda1,mode=rw,mountpoint=/,type=ext4,state=used} 0
otel-collector-1  | system.filesystem.inodes.usage{device=/dev/sda1,mode=rw,mountpoint=/,type=ext4,state=free} 0
otel-collector-1  | system.filesystem.usage{device=/dev/sda1,mode=rw,mountpoint=/,type=ext4,state=used} 0
otel-collector-1  | system.filesystem.usage{device=/dev/sda1,mode=rw,mountpoint=/,type=ext4,state=free} 0
otel-collector-1  | system.filesystem.usage{device=/dev/sda1,mode=rw,mountpoint=/,type=ext4,state=reserved} 0
otel-collector-1  | system.filesystem.utilization{device=/dev/sda1,mode=rw,mountpoint=/,type=ext4} 0

Collector version

v0.104.0

Environment information

Environment Information

• OS: Ubuntu 20.04
• Collector Installation Method: Docker
• Docker Image: otel/opentelemetry-collector-contrib:0.104.0

OpenTelemetry Collector configuration

receivers:
  hostmetrics:
    scrapers:
      filesystem:
        metrics:
          system.filesystem.utilization:
            enabled: true
          system.filesystem.usage:
            enabled: true
          system.filesystem.inodes.usage:
            enabled: true

exporters:
  logging:

service:
  pipelines:
    metrics:
      receivers: [hostmetrics]
      exporters: [logging]

Log output

system.filesystem.inodes.usage{device=/dev/sda1,mode=rw,mountpoint=/,type=ext4,state=used} 0
system.filesystem.inodes.usage{device=/dev/sda1,mode=rw,mountpoint=/,type=ext4,state=free} 0
system.filesystem.usage{device=/dev/sda1,mode=rw,mountpoint=/,type=ext4,state=used} 0
system.filesystem.usage{device=/dev/sda1,mode=rw,mountpoint=/,type=ext4,state=free} 0
system.filesystem.usage{device=/dev/sda1,mode=rw,mountpoint=/,type=ext4,state=reserved} 0
system.filesystem.utilization{device=/dev/sda1,mode=rw,mountpoint=/,type=ext4} 0

Additional context

No response

@vimalraj3 vimalraj3 added bug Something isn't working needs triage New item requiring triage labels Aug 30, 2024
Copy link
Contributor

Pinging code owners:

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

@braydonk
Copy link
Contributor

I noticed you installed the Collector with the Docker container. Can you try following these steps from the README to make sure you are collecting metrics from the host and not the container?

@vimalraj3
Copy link
Author

Thanks, I used /hostfs/proc instead of /hostfs. My bad, and I am closing this issue.

@vimalraj3
Copy link
Author

vimalraj3 commented Sep 14, 2024

@braydonk

Issue: Filesystem Metrics Always Return Zero

Description:
The filesystem metrics (system.filesystem.utilization and system.filesystem.usage) from the hostmetrics/disk receiver in the OpenTelemetry Collector always return zero values. Other metrics (CPU, memory) are reporting correctly.

Configuration:

receivers:
  hostmetrics:
    root_path: ${env:HOST_PROC}
    scrapers:
      disk:
        metrics:
          system.disk.io_time:
            enabled: false
          system.disk.merged:
            enabled: false
          system.disk.operation_time:
            enabled: false
          system.disk.operations:
            enabled: false
          system.disk.pending_operations:
            enabled: false
          system.disk.weighted_io_time:
            enabled: false
      filesystem:
        metrics:
          system.filesystem.utilization:
            enabled: true
          system.filesystem.usage:
            enabled: true
      paging:
        metrics:
          system.paging.utilization:
            enabled: true
    collection_interval: 60s

exporters:
  debug:
    verbosity: detailed
service:
  pipelines:
    metrics/hostmetrics:
      receivers: [hostmetrics]
      processors: [resourcedetection/docker]
      exporters: [clickhouse]

Docker Compose:

version: "3.7"
services:
  otel-collector:
    image: otel/opentelemetry-collector-contrib:0.104.0
    volumes:
      - /proc:/hostfs/proc
      - /:/hostfs
    env_file:
      - .env
    command: ["--config=/etc/otel/config.yaml"]
    restart: always

Environment Variable:

HOST_PROC="/hostfs"

Expected Behavior:
Filesystem metrics should report correct non-zero values.

Actual Behavior:
Filesystem metrics return zero values.

Additional Information:

  • Other metrics are working fine.
  • Issue persists even with privileged mode.

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

3 participants