Skip to content

[os-node_exporter] Add textfile collector directory support #5454

@StevenWolfe

Description

@StevenWolfe

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe.
The os-node_exporter plugin exposes a fixed set of built-in collectors via toggle checkboxes, but provides no way to enable node_exporter's textfile collector. The textfile collector is the upstream-recommended escape hatch for custom or platform-specific metrics that don't have a built-in collector — for example, active SSH session counts, SMART drive data, or gateway health — none of which are available as native FreeBSD collectors in node_exporter. Without textfile support, users have no supported path to add custom metrics through this plugin.

Describe the solution you'd like
Add an optional "Textfile Directory" text field to the node_exporter settings page (Services → Node Exporter). When a path is provided, the plugin passes --collector.textfile.directory=<path> to the node_exporter daemon at startup. When left empty, behavior is unchanged. Users are then free to drop .prom files into that directory (via cron, configd actions, or other scripts) and have them scraped alongside the built-in collectors.

Describe alternatives you've considered

Additional context
The textfile collector is enabled by default in the upstream node_exporter binary (including the FreeBSD port) — it just requires --collector.textfile.directory to be set. The change to the plugin is minimal: one new TextField in the model, one conditional block in the RC conf template, and one form field in the UI — the same pattern used when ZFS and IPv6 listen address support were added.

A pull request will follow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions