exporter

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 12

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 NewCollector added in v1.1.9

func NewCollector(metrics []Metric) prometheus.Collector

New is creates a Collector.

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

func RegisterCollector added in v1.1.9

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

Register registers the Collectors.

ex) err := exporter.RegisterCollector(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 UnRegisterCollector added in v1.1.9

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

UnRegister unregister the Collectors.

ex) result := exporter.UnRegisterCollector(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