collector

package
v0.0.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultEnabled  = true
	DefaultDisabled = false
)

Variables

This section is empty.

Functions

func RegisterAPI

func RegisterAPI(clientAPI ClientAPI)

func RegisterCollector

func RegisterCollector(collector string, flag *bool, factory func(logger *slog.Logger) (Collector, error))

Types

type ClientAPI

type ClientAPI interface {
	Login(target string, logger *slog.Logger) (map[string]interface{}, error)
	Logout(loginData map[string]interface{}, logger *slog.Logger) error
	Get(loginData, extraConfig map[string]interface{}, logger *slog.Logger) (interface{}, error)
}

type Collector

type Collector interface {
	Update(ch chan<- prometheus.Metric, namespace string, clientAPI ClientAPI, clientData map[string]interface{}, extraParams map[string]string) error
}

Collector is the interface a collector has to implement.

type CollectorSet

type CollectorSet struct {
	Collectors map[string]Collector

	ScrapeMetrics ScrapeMetrics
	// contains filtered or unexported fields
}

func NewCollectorSet

func NewCollectorSet(namespace, target string, params map[string]string, logger *slog.Logger) (CollectorSet, error)

func (*CollectorSet) Collect

func (cs *CollectorSet) Collect(ch chan<- prometheus.Metric)

func (*CollectorSet) Describe

func (cs *CollectorSet) Describe(ch chan<- *prometheus.Desc)

type ScrapeMetrics

type ScrapeMetrics struct {
	Success  *prometheus.Desc
	Duration *prometheus.Desc
}

Jump to

Keyboard shortcuts

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