HTTPConf is exported to receive YAML configuration.
type HTTPConf struct { URL string `yaml:"url"` RCodes []int `yaml:"rcodes"` UserAgent string `yaml:"useragent"` Insecure bool `yaml:"insecure"` }
func (c HTTPConf) Instrument() map[string]prometheus.Collector
Instrument is a no-op to implement the `Configurer` interface.
func (c HTTPConf) Kind() string
Kind returns a name that uniquely identifies the `Kind` of `Configurer`.
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 (c HTTPConf) UnmarshalSettings(settings []byte) (probers.Configurer, error)
UnmarshalSettings takes YAML as bytes and unmarshals it to the to an HTTPConf object.
HTTPProbe is the exported 'Prober' object for monitors configured to perform HTTP requests.
type HTTPProbe struct {
// contains filtered or unexported fields
}
func (p HTTPProbe) Kind() string
Kind returns a name that uniquely identifies the `Kind` of `Prober`.
func (p HTTPProbe) Name() string
func (p HTTPProbe) Probe(timeout time.Duration) (bool, time.Duration)
Probe performs the configured HTTP request.