-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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] filesystem scraper doesn't respect root_path #35990
Comments
Pinging code owners: See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@povilasv is there a work around? |
Workaround is to manually set the env var: HOST_PROC_MOUNTINFO=/hostfs/proc/1 |
@povilasv, there is the same issue here after upgrading to the latest version.
|
@marcelaraujo try setting the environment variable to HOST_PROC_MOUNTINFO=/hostfs/proc/1 it should workaround this issue |
Hi @povilasv It didn't work. What should be the values for this case? env:
- name: HOST_PROC_MOUNTINFO
value: /proc/1/self
volumes:
- name: hostfs
hostPath:
path: /
volumeMounts:
- name: hostfs
mountPath: /hostfs
readOnly: true
mountPropagation: HostToContainer
config:
receivers:
hostmetrics:
root_path: /hosts When I tried using your environment variable, I got a different issue
|
Looking at this issue and going to attempt to reproduce ; the environment variable is used in 2 places and setting it as a workaround might not be the fix. |
Using your config file, on Mac, trying to reproduce:
I don't see the error reported. I will try to reproduce on a Linux VM next. |
Reproducing on Linux now, taking it further. |
Adding
|
Using |
@atoulme Confirming the suggestion worked. |
…e system is mounted (open-telemetry#36000) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Do not set the default value of HOST_PROC_MOUNTINFO to respect root_path <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#35990
Component(s)
receiver/hostmetrics
What happened?
Description
Looks like #35504 gave us a regression.
Now filesystem scraper ignores root_path and tries to just open /mounts althought root_path is set. Uses with root_path will start getting these errors, and no filesystem metrics:
IMO this is an important regression, as we use this in opentelemetry-helm-charts hostMetrics preset -> https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-collector/templates/_config.tpl#L71-L88
Steps to Reproduce
You will get:
although it should try to open /tmp/mounts
Expected Result
Actual Result
Collector version
v0.102.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: