collector

package
v0.0.0-...-88de01b Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const NAMESPACE = "ha_cluster"

Variables

This section is empty.

Functions

func CheckExecutables

func CheckExecutables(paths ...string) error

check that all the given paths exist and are executable files

Types

type DefaultCollector

type DefaultCollector struct {
	Clock clock.Clock

	Logger log.Logger
	// contains filtered or unexported fields
}

func NewDefaultCollector

func NewDefaultCollector(subsystem string, timestamps bool, logger log.Logger) DefaultCollector

func (*DefaultCollector) Describe

func (c *DefaultCollector) Describe(ch chan<- *prometheus.Desc)

func (*DefaultCollector) GetDescriptor

func (c *DefaultCollector) GetDescriptor(name string) *prometheus.Desc

func (*DefaultCollector) GetSubsystem

func (c *DefaultCollector) GetSubsystem() string

func (*DefaultCollector) MakeCounterMetric

func (c *DefaultCollector) MakeCounterMetric(name string, value float64, labelValues ...string) prometheus.Metric

func (*DefaultCollector) MakeGaugeMetric

func (c *DefaultCollector) MakeGaugeMetric(name string, value float64, labelValues ...string) prometheus.Metric

func (*DefaultCollector) SetDescriptor

func (c *DefaultCollector) SetDescriptor(name, help string, variableLabels []string)

Convenience wrapper around prometheus.NewDesc constructor. Stores a metric descriptor with a fully qualified name like `NAMESPACE_subsystem_name`. `name` is the last and most relevant part of the metrics Full Qualified Name; `help` is the message displayed in the HELP line `variableLabels` is a list of labels to declare. Use `nil` to declare no labels.

type InstrumentableCollector

type InstrumentableCollector interface {
	prometheus.Collector
	SubsystemCollector
	CollectWithError(ch chan<- prometheus.Metric) error
}

describes a collector that can return errors from collection cycles, instead of the default Prometheus one, which has void Collect returns

type InstrumentedCollector

type InstrumentedCollector struct {
	Clock clock.Clock
	// contains filtered or unexported fields
}

func NewInstrumentedCollector

func NewInstrumentedCollector(collector InstrumentableCollector, logger log.Logger) *InstrumentedCollector

func (*InstrumentedCollector) Collect

func (ic *InstrumentedCollector) Collect(ch chan<- prometheus.Metric)

func (*InstrumentedCollector) Describe

func (ic *InstrumentedCollector) Describe(ch chan<- *prometheus.Desc)

func (*InstrumentedCollector) GetSubsystem

func (ic *InstrumentedCollector) GetSubsystem() string

type SubsystemCollector

type SubsystemCollector interface {
	GetSubsystem() string
}

Directories

Path Synopsis
cib

Jump to

Keyboard shortcuts

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