mountinfo

package module
v0.0.0-...-b314c0b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 7

README

github.com/sourcegraph/mountinfo

This Go package provides a Prometheus collector that advertises the names of block storage devices backing the requested file paths.

See the doc comment for NewCollector in info.go for more information.

(snippet):

// 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")

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL