prometheus

package
v8.42.1698085480-SHA-e... Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 10 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 is a

func NewScraper

func NewScraper(conf ScraperConfig) *Scraper

NewScraper returns a Scraper with the provided configuration.

func (*Scraper) Start

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

Start kicks off the scraping process in the current goroutine. Will stop when the provided context is cancelled or on the first encountered error.

type ScraperConfig

type ScraperConfig struct {
	Clock clockwork.Clock

	// ExporterURL is the URL that hosts the metrics page for a Prometheus
	// exporter.
	ExporterURL string
	// NodeID is the ID of the node associated with the generated
	// NetworkStatsReports.
	NodeID string
	// ScrapeInterval is how frequently the scraper should scrape metrics.
	ScrapeInterval time.Duration
	// Callback gets called once a NetworkStatsReport is generated. A non-nil
	// error will stop the scraper.
	Callback func(*apipb.NetworkStatsReport) error
}

ScraperConfig represents the configuration for a prometheus scraper.

Jump to

Keyboard shortcuts

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