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

Host metrics not including filesystem when specifying / as mount point #21203

Open
kvaggelakos opened this issue Sep 4, 2024 · 3 comments
Open
Labels
source: host_metrics Anything `host_metrics` source related type: bug A code related bug.

Comments

@kvaggelakos
Copy link

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

My vector seems to have an issue when I specify the mount point to be /. The host metrics appear for the filesystem when I specify * instead.

So in the working case (specifying *), it looks like this:

host_filesystem_free_bytes{collector="filesystem",filesystem="virtiofs",host="592075aabe13",mountpoint="/"} = 21131915264

In the broken case there are no host_filesystem_free_bytes metrics.

Configuration

[sources.host_metrics]
type = "host_metrics"
collectors = ["cpu", "filesystem", "memory", "network"]
filesystem.mountpoints.includes = ["/"]

Version

0.40.0

Debug Output

No response

Example Data

No response

Additional Context

No response

References

This is the only thing that seemed relevant: #6923

@kvaggelakos kvaggelakos added the type: bug A code related bug. label Sep 4, 2024
@jszwedko jszwedko added the source: host_metrics Anything `host_metrics` source related label Sep 6, 2024
@jszwedko
Copy link
Member

jszwedko commented Sep 6, 2024

Thanks for this report! As a workaround you could collect metrics for all mount points and then filter afterwards with a filter transform.

Can you share more details about the environment Vector is running in? I tried to reproduce on MacOS but I wasn't able to. I used this config:

sources:
  source0:
    collectors:
    - cpu
    - filesystem
    - memory
    - network
    namespace: host
    scrape_interval_secs: 1
    type: host_metrics
    filesystem:
      mountpoints:
        includes: ["/"]
sinks:
  sink0:
    inputs:
    - source0
    type: console
    encoding:
      codec: json

And I saw:

$ ❯ vector-0.40.0 --config /tmp/tmp.yaml | grep filesystem_free_bytes
2024-09-06T22:34:08.789705Z  INFO vector::app: Log level is enabled. level="info"
2024-09-06T22:34:08.790521Z  INFO vector::app: Loading configs. paths=["/tmp/tmp.yaml"]
2024-09-06T22:34:08.791836Z  INFO vector::topology::running: Running healthchecks.
2024-09-06T22:34:08.791928Z  INFO vector::topology::builder: Healthcheck passed.
2024-09-06T22:34:08.791982Z  INFO vector: Vector has started. debug="false" version="0.40.0" arch="aarch64" revision=""
2024-09-06T22:34:08.792004Z  INFO vector::app: API is disabled, enable by setting `api.enabled` to `true` and use commands like `vector top`.
{"name":"filesystem_free_bytes","namespace":"host","tags":{"collector":"filesystem","device":"/dev/disk3s1s1","filesystem":"apfs","host":"xxx","mountpoint":"/"},"timestamp":"2024-09-06T22:34:08.793033Z","kind":"absolute","gauge":{"value":28292816896.0}}

@jszwedko
Copy link
Member

jszwedko commented Sep 6, 2024

I also tried on an Ubuntu 20.04 system and it worked fine too:

➜  vector git:(master) ✗ vector --config /tmp/tmp.yaml | grep filesystem_free_bytes
2024-09-06T22:35:18.391018Z  INFO vector::app: Log level is enabled. level="info"
2024-09-06T22:35:18.393318Z  INFO vector::app: Loading configs. paths=["/tmp/tmp.yaml"]
2024-09-06T22:35:18.399703Z  INFO source{component_kind="source" component_id=source0 component_type=host_metrics}: vector::sources::host_metrics: PROCFS_ROOT is unset. Using default '/proc' for procfs root.
2024-09-06T22:35:18.399798Z  INFO source{component_kind="source" component_id=source0 component_type=host_metrics}: vector::sources::host_metrics: SYSFS_ROOT is unset. Using default '/sys' for sysfs root.
2024-09-06T22:35:18.400462Z  INFO vector::topology::running: Running healthchecks.
2024-09-06T22:35:18.400638Z  INFO vector::topology::builder: Healthcheck passed.
2024-09-06T22:35:18.400915Z  INFO vector: Vector has started. debug="true" version="0.41.0" arch="x86_64" revision=""
{"name":"filesystem_free_bytes","namespace":"host","tags":{"collector":"filesystem","device":"overlay","filesystem":"overlay","host":"vector3","mountpoint":"/"},"timestamp":"2024-09-06T22:35:18.401654752Z","kind":"absolute","gauge":{"value":148724862976.0}}

🤔

I think more details about your environment would be helpful like OS version.

@kvaggelakos
Copy link
Author

kvaggelakos commented Sep 9, 2024

Thanks for looking into this.

My host uses kata containers. The filesystem documentation is here: https://github.com/kata-containers/documentation/blob/master/how-to/how-to-use-virtio-fs-with-kata.md

This is the results of df -h.

Filesystem      Size  Used Avail Use% Mounted on
none             20G  266M   20G   2% /
tmpfs            64M     0   64M   0% /dev
tmpfs           350M     0  350M   0% /sys/fs/cgroup
shm             350M     0  350M   0% /dev/shm
kataShared      7.3T  613G  6.7T   9% /etc/hosts

The container is based on ubuntu 22.

uname -r
6.1.38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source: host_metrics Anything `host_metrics` source related type: bug A code related bug.
Projects
None yet
Development

No branches or pull requests

2 participants