exporter

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 7

Documentation

Overview

Package exporter provides prometheus exporter implementations.

Package exporter provides prometheus exporter implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(metrics []Metric) prometheus.Collector

New is creates a Collector.

ex) collector01 := exporter.New([]exporter.Metric{...})

func Register

func Register(collectors ...prometheus.Collector) error

Register registers the Collectors.

ex) err := exporter.Register(collector01)

func Start

func Start(address, urlPath string, listenAndServeFailureFunc func(error)) error

Start is start the server.

ex) err := exporter.Start(":10000", "metrics", func(err error) { klog.ErrorS(err, "") })

func Stop

func Stop(timeout time.Duration) error

Stop is stop the server.

ex) err := exporter.Stop(60)

func UnRegister

func UnRegister(collectors ...prometheus.Collector) bool

UnRegister unregister the Collectors.

ex) result := exporter.UnRegister(collector01)

Types

type Metric

type Metric interface {
	GetDesc() *prometheus.Desc
	GetValueType() prometheus.ValueType
	GetValues() []Value
}

Metric is an interface that provides the information to be collected.

type Value

type Value struct {
	Value       float64
	LabelValues []string
}

value is a struct that provides the value to collect.

Jump to

Keyboard shortcuts

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