exporter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 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
}

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

Jump to

Keyboard shortcuts

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