probers

package
v0.0.0-...-3baac6f Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MPL-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 HTTPConf

type HTTPConf struct {
	URL       string `yaml:"url"`
	RCodes    []int  `yaml:"rcodes"`
	UserAgent string `yaml:"useragent"`
	Insecure  bool   `yaml:"insecure"`
}

HTTPConf is exported to receive YAML configuration.

func (HTTPConf) Instrument

func (c HTTPConf) Instrument() map[string]prometheus.Collector

Instrument is a no-op to implement the `Configurer` interface.

func (HTTPConf) Kind

func (c HTTPConf) Kind() string

Kind returns a name that uniquely identifies the `Kind` of `Configurer`.

func (HTTPConf) MakeProber

func (c HTTPConf) MakeProber(_ map[string]prometheus.Collector) (probers.Prober, error)

MakeProber constructs a `HTTPProbe` object from the contents of the bound `HTTPConf` object. If the `HTTPConf` cannot be validated, an error appropriate for end-user consumption is returned instead.

func (HTTPConf) UnmarshalSettings

func (c HTTPConf) UnmarshalSettings(settings []byte) (probers.Configurer, error)

UnmarshalSettings takes YAML as bytes and unmarshals it to the to an HTTPConf object.

type HTTPProbe

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

HTTPProbe is the exported 'Prober' object for monitors configured to perform HTTP requests.

func (HTTPProbe) Kind

func (p HTTPProbe) Kind() string

Kind returns a name that uniquely identifies the `Kind` of `Prober`.

func (HTTPProbe) Name

func (p HTTPProbe) Name() string

func (HTTPProbe) Probe

func (p HTTPProbe) Probe(timeout time.Duration) (bool, time.Duration)

Probe performs the configured HTTP request.

Jump to

Keyboard shortcuts

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