collector

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const MaxConcurrentChecks = 3

MaxConcurrentChecks specifies the maximum number of sites that can be checked concurrently

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	// Targets to check
	Targets []checker.Checker
	// MaxConcurrentChecks limits the number of checks to perform concurrently. Defaults to MaxConcurrentChecks
	MaxConcurrentChecks int64
}

Collector checks the status of a list of Targets and exposes the results as Prometheus scrape metrics

func New

func New(targets config.Targets) *Collector

New creates a new Collectors for the provided targets

func (Collector) Collect

func (c Collector) Collect(ch chan<- prometheus.Metric)

Collect implements the Prometheus Collector interface. It checks each target and exposes the results as Prometheus metrics. Collect limits the number of checks that are performed concurrently, as specified by ConcurrentChecks.

func (Collector) Describe

func (c Collector) Describe(ch chan<- *prometheus.Desc)

Describe implements the Prometheus Collector interface

Jump to

Keyboard shortcuts

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