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 ¶
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.