Skip to content

Warn at startup when explicitly configured filesystem paths are unusable #3832

Description

@LionelTrichet

Containerized node_exporter deployments often depend on bind-mounted host filesystems together with flags such as:

--path.rootfs=/host
--path.procfs=/host/proc
--path.sysfs=/host/sys

A small mistake in those mounts can be harder to diagnose than it needs to be.

For example, if /host/proc is missing, mounted incorrectly, or not accessible inside the container, node_exporter can still start successfully. The problem then shows up later through collector errors, missing metrics, or values coming from the container namespace instead of the host.

That makes a simple deployment mistake look like a metrics or collector problem.

I think it would be useful to validate filesystem paths that were explicitly overridden and emit a warning at startup when one is clearly unusable.

The validation could stay intentionally lightweight:

  • path does not exist
  • path is not a directory
  • path cannot be accessed by the exporter

For procfs and sysfs, it may also be possible to cheaply detect paths that clearly do not point to the expected filesystem, as long as that doesn't introduce assumptions about files required by individual collectors.

I would keep this as a warning rather than a startup error. A partially working exporter can still be useful, and unusual environments shouldn't be rejected just because they don't look like a typical Linux host.

For example, starting with:

--path.procfs=/host/proc

when /host/proc is not actually mounted could produce a startup message along the lines of:

level=warn msg="Configured procfs path is not usable" path=/host/proc

The exporter could then continue with its current behavior.

I'd also limit the check to paths explicitly set by the user. That keeps the existing defaults untouched and makes the warning directly actionable: if someone configured a custom host path, they get an early indication that the path doesn't look usable.

The goal isn't to fully validate a host mount or predict every collector failure. It's just to catch obvious configuration mistakes at startup, before they turn into confusing scrape-time behavior.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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