ksm

package
v3.28.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Providers

type Providers struct {
	K8s kubernetes.Interface
	KSM prometheus.MetricFamiliesGetFunc
}

Providers is a struct holding pointers to all the clients Scraper needs to get data from. TODO: Extract this out of the KSM package.

type Scraper

type Scraper struct {
	Providers

	Filterer discovery.NamespaceFilterer
	// contains filtered or unexported fields
}

Scraper takes care of getting metrics from an autodiscovered KSM instance.

func NewScraper

func NewScraper(config *config.Config, providers Providers, options ...ScraperOpt) (*Scraper, error)

NewScraper builds a new Scraper, initializing its internal informers. After use, informers should be closed by calling Close() to prevent resource leakage.

func (*Scraper) Close

func (s *Scraper) Close()

Close will signal internal informers to stop running.

func (*Scraper) Run

func (s *Scraper) Run(i *integration.Integration) error

Run runs the scraper, adding all the KSM-related metrics and entities into the integration i. Run must not be called after Close().

type ScraperOpt

type ScraperOpt func(s *Scraper) error

ScraperOpt are options that can be used to configure the Scraper

func WithFilterer added in v3.3.0

func WithFilterer(filterer discovery.NamespaceFilterer) ScraperOpt

WithFilterer returns an OptionFunc to add a Filterer.

func WithLogger

func WithLogger(logger *log.Logger) ScraperOpt

WithLogger returns an OptionFunc to change the logger from the default noop logger.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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