Documentation ¶
Overview ¶
Package mountinfo provides a Prometheus collector that advertises the names of block storage devices backing the requested file paths.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCollector ¶
func NewCollector(logger sglog.Logger, opts CollectorOpts, mounts map[string]string) prometheus.Collector
NewCollector returns a Prometheus collector that collects a single metric, "mount_point_info", that contains the names of the block storage devices backing each of the requested mounts.
Mounts is a set of name -> file path mappings (example: {"indexDir": "/home/.zoekt"}).
The metric "mount_point_info" has a constant value of 1 and two labels:
- mount_name: caller-provided name for the given mount (example: "indexDir")
- device: name of the block device that backs the given mount file path (example: "sdb")
This metric currently works only on Linux-based operating systems that have access to the sysfs pseudo-filesystem. On all other operating systems, this metric will not emit any values.
Types ¶
type CollectorOpts ¶
type CollectorOpts struct { // If non-empty, Namespace prefixes the "mount_point_info" metric by the provided string and // an underscore ("_"). Namespace string }
CollectorOpts modifies the behavior of the metric created by NewCollector.