prometheus

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const MetricCollectorNamePrometheus = "prometheus-collector"
View Source
const MetricCollectorNameShardingPrometheus = "sharding-prometheus-collector"

Variables

This section is empty.

Functions

Types

type ScrapeManager

type ScrapeManager struct {

	// lastScrapeSize is used to initialize the buffer size using historical length
	sync.Mutex
	// contains filtered or unexported fields
}

ScrapeManager is responsible for scraping logic through http requests and each endpoint will have one manager instance for efficiency.

func NewScrapeManager

func NewScrapeManager(ctx context.Context, outOfDataPeriod time.Duration, client *http.Client, node, url string, emitter metrics.MetricEmitter) (*ScrapeManager, error)

func (*ScrapeManager) HandleMetric

func (s *ScrapeManager) HandleMetric(f func(d []*data.MetricSeries, tags ...metrics.MetricTag) error)

HandleMetric handles the in-cached metric, clears those metric if handle successes keep them in memory otherwise

func (*ScrapeManager) Start

func (s *ScrapeManager) Start(duration time.Duration)

func (*ScrapeManager) Stop

func (s *ScrapeManager) Stop()

Jump to

Keyboard shortcuts

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