metrics

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: LGPL-2.1 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClusterIDLabel = MetricLabel{
	Name: "cluster_id",
	Help: "Cluster ID",
}

Functions

func CollectMetrics added in v0.2.6

func CollectMetrics() (chan struct{}, error)

CollectMetrics collects all the registered metrics

func InitGluterMetrics

func InitGluterMetrics(clusterLabel string, configPath string, metrics []string) error

Types

type DiskStatus

type DiskStatus struct {
	All        float64 `json:"all"`
	Used       float64 `json:"used"`
	Free       float64 `json:"free"`
	InodesAll  float64 `json:"inodesall"`
	InodesFree float64 `json:"inodesfree"`
	InodesUsed float64 `json:"inodesused"`
}

DiskStatus represents Disk usage

type ExportedGaugeVec

type ExportedGaugeVec struct {
	Namespace string
	Name      string
	Help      string
	LongHelp  string
	Labels    []string
	GaugeVec  *prometheus.GaugeVec
	Metrics   map[uint64]MetricWithTTL
	TTL       time.Duration
}

ExportedGaugeVec represents each GaugeVec with additional information

func (*ExportedGaugeVec) RemoveStaleMetrics

func (gv *ExportedGaugeVec) RemoveStaleMetrics()

RemoveStaleMetrics removes all the stale metrics which are not exported for TTL period.

func (*ExportedGaugeVec) Set

func (gv *ExportedGaugeVec) Set(labels prometheus.Labels, value float64)

Set updates the Gauge Value and last update time

type LVMStat

type LVMStat struct {
	Device          string
	UUID            string
	Name            string
	DataPercent     float64
	PoolLV          string
	Attr            string
	Size            float64
	Path            string
	MetadataSize    float64
	MetadataPercent float64
	VGName          string
	VGExtentTotal   float64
	VGExtentAlloc   float64
}

LVMStat represents LVM details

type Metric

type Metric struct {
	Name      string
	Help      string
	LongHelp  string
	Namespace string
	Disabled  bool
	Labels    []MetricLabel
	TTL       time.Duration
}

Metric represents Prometheus metric

func (*Metric) LabelNames

func (m *Metric) LabelNames() []string

LabelNames returns list of Prometheus labels

type MetricLabel

type MetricLabel struct {
	Name string
	Help string
}

MetricLabel represents Prometheus Label

type MetricWithTTL

type MetricWithTTL struct {
	LastUpdated time.Time
	Labels      prometheus.Labels
}

MetricWithTTL represents the metric with label combinations and Last updated time details

type PeerMetrics

type PeerMetrics struct {
	PVCount          int            // total Physical Volume counts
	LVCountMap       map[string]int // collects lv count for each Volume Group
	ThinPoolCountMap map[string]int // collects thinpool count for each Volume Group
	VGCount          int            // no: of Volume Groups
}

PeerMetrics : exposes PV, LV, VG counts

func NewPeerMetrics

func NewPeerMetrics() (*PeerMetrics, error)

NewPeerMetrics : provides a way to get the consolidated metrics (such PV, LV, VG counts)

type ProcMounts

type ProcMounts struct {
	Name         string
	Device       string
	FSType       string
	MountOptions string
}

ProcMounts represents list of items from /proc/mounts

type ThinPoolStat

type ThinPoolStat struct {
	ThinPoolName          string
	ThinPoolVGName        string
	ThinPoolDataTotal     float64
	ThinPoolDataUsed      float64
	ThinPoolMetadataTotal float64
	ThinPoolMetadataUsed  float64
}

ThinPoolStat represents thin pool LV details

type VGDetails

type VGDetails struct {
	LVUUID          string `json:"lv_uuid"`
	LVName          string `json:"lv_name"`
	DataPercent     string `json:"data_percent"`
	PoolLV          string `json:"pool_lv"`
	LVAttr          string `json:"lv_attr"`
	LVSize          string `json:"lv_size"`
	LVPath          string `json:"lv_path"`
	LVMetadataSize  string `json:"lv_metadata_size"`
	MetadataPercent string `json:"metadata_percent"`
	VGName          string `json:"vg_name"`
	VGExtentTotal   string `json:"vg_extent_count"`
	VGExtentFree    string `json:"vg_free_count"`
}

VGDetails represents a single VG detail

type VGReport

type VGReport struct {
	Report []VGs `json:"report"`
}

VGReport represents VG details

type VGs

type VGs struct {
	Vgs []VGDetails `json:"vg"`
}

VGs represents list VG Details

Jump to

Keyboard shortcuts

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