metrics_scraper

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scraper

type Scraper struct {
	// contains filtered or unexported fields
}

Scraper tracks the kube-apiserver pods in a input_data_registry.InputDataRegistry and populates the registry back with metrics scraped from the pods

Remarks: The current Scraper implementation is meant for seeds which contain 20-6000 shoot kube-apiserver pods. With a much lower number of shoots, operation is functionally correct, but somewhat suboptimal. With a much higher number of shoots, contention for some internal synchronisation objects may become a bottleneck.

func NewScraper

func NewScraper(
	dataRegistry input_data_registry.InputDataRegistry,
	scrapePeriod time.Duration,
	scrapeFlowControlPeriod time.Duration,
	log logr.Logger) *Scraper

NewScraper creates a new Scraper object which tracks the kube-apiserver pods in the specified dataRegistry and populates the registry back with metrics scraped from the pods.

scrapePeriodMilliseconds is how often the same pod will be scraped. scrapeFlowControlPeriodMilliseconds is how often the Scraper will adjust the number of parallel workers responsible for the actual pod scraping.

func (*Scraper) ScrapeQueue

func (s *Scraper) ScrapeQueue(ctx context.Context)

ScrapeQueue sequentially picks targets from the queue and scrapes them, until there are no more eligible targets.

func (*Scraper) Start

func (s *Scraper) Start(ctx context.Context) error

Start implements sigs.k8s.io/controller-runtime/pkg/manager.Runnable. It starts data gathering activities and only returns after all such activities have stopped.

Errors which occur during individual scrapes do not terminate the overall scraping process, and are thus not reflected in the error returned by this function.

Jump to

Keyboard shortcuts

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