exporter

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Registry func(src GMetricSource, metrics []GMetric) error

Registry is a variable of type func(src GMetricSource, metrics []GMetric) error. It is used to register metric sources with the promExporter.

Functions

func New

func New(cfg Config) (*promExporter, error)

New creates a new promExporter instance with the provided configuration.

Types

type Config

type Config struct {
	ListenAddress string
	ListenPort    string
	ListenPath    string
	InstanceName  string
	MetricPrefix  string
	StaticLabels  []StaticLabel
}

type GMetric

type GMetric interface {
	// contains filtered or unexported methods
}

GMetric is an interface that represents a generic metric. User defined metrics must implement this interface

type GMetricSource

type GMetricSource interface {
	GetMetrics(ch chan<- GMetric)
}

GMetricSource is an interface for objects that provide metrics.

type MetricCommons

type MetricCommons struct {
	Name   string // Name of the metric
	Help   string // Help string for Prom metric description
	Device string // Device name (gnmi client)
	Type   prometheus.ValueType
	Value  float64
}

MetricCommons represents a common set of keys of a metric used in the application. Metric sources must embed this structure into their user defined metrics

type StaticLabel added in v1.2.0

type StaticLabel struct {
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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