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

path.rootfs stripping strips path.rootfs itself to the empty string #1463

Closed
dt-rush opened this issue Aug 29, 2019 · 1 comment
Closed

path.rootfs stripping strips path.rootfs itself to the empty string #1463

dt-rush opened this issue Aug 29, 2019 · 1 comment

Comments

@dt-rush
Copy link
Contributor

dt-rush commented Aug 29, 2019

Host operating system: output of uname -a

all OS

node_exporter version: output of node_exporter --version

this is on master but not yet released.

node_exporter command line flags

See below

Are you running node_exporter in Docker?

Yes

What did you do that produced an error?

Dockerfile:

FROM golang

RUN apt-get update && apt-get -y install git build-essential

RUN git clone https://github.com/prometheus/node_exporter && \
	cd node_exporter && \
	make build && \
	cp node_exporter /usr/bin/

CMD ["node_exporter", "--web.listen-address=:9000", "--web.telemetry-path=/metrics", "--path.rootfs=/host"]

Build:

docker build -t node_exporter .

Then run the container:

docker run -d --rm -v /:/host:ro,rslave -p "9000:9000" node_exporter

Then, curl the container and grep for the empty string in the mountpoint label:

$ curl -s localhost:9000/metrics | grep 'mountpoint=""'

node_filesystem_avail_bytes{device="/dev/nvme0n1p2",fstype="ext4",mountpoint=""} 3.94300260352e+11
node_filesystem_device_error{device="/dev/nvme0n1p2",fstype="ext4",mountpoint=""} 0
node_filesystem_files{device="/dev/nvme0n1p2",fstype="ext4",mountpoint=""} 3.0130176e+07
node_filesystem_files_free{device="/dev/nvme0n1p2",fstype="ext4",mountpoint=""} 2.9022094e+07
node_filesystem_free_bytes{device="/dev/nvme0n1p2",fstype="ext4",mountpoint=""} 4.18995941376e+11
node_filesystem_readonly{device="/dev/nvme0n1p2",fstype="ext4",mountpoint=""} 1
node_filesystem_size_bytes{device="/dev/nvme0n1p2",fstype="ext4",mountpoint=""} 4.84756549632e+11

What did you expect to see?

The mountpoint label should strip down to "/", not the empty string.

What did you see instead?

mountpoint has "" as its value.

dt-rush added a commit to dt-rush/node_exporter that referenced this issue Sep 9, 2019
Change-type: patch
Connects-to: prometheus#1463
Signed-off-by: dt-rush <[email protected]>
SuperQ pushed a commit that referenced this issue Sep 9, 2019
Change-type: patch
Connects-to: #1463
Signed-off-by: dt-rush <[email protected]>
@SuperQ
Copy link
Member

SuperQ commented Sep 9, 2019

Fixed by #1464

@SuperQ SuperQ closed this as completed Sep 9, 2019
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this issue Apr 9, 2024
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this issue Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants