Skip to content

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

@dt-rush

Description

@dt-rush

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions