DNSConf is exported to receive YAML configuration
type DNSConf struct { Proto string `yaml:"protocol"` Server string `yaml:"server"` Recurse bool `yaml:"recurse"` QName string `yaml:"query_name"` QType string `yaml:"query_type"` }
func (c DNSConf) Instrument() map[string]prometheus.Collector
Instrument is a no-op to implement the `Configurer` interface.
func (c DNSConf) Kind() string
Kind returns a name that uniquely identifies the `Kind` of `Configurer`.
func (c DNSConf) MakeProber(_ map[string]prometheus.Collector) (probers.Prober, error)
MakeProber constructs a `DNSProbe` object from the contents of the bound `DNSConf` object. If the `DNSConf` cannot be validated, an error appropriate for end-user consumption is returned instead.
func (c DNSConf) UnmarshalSettings(settings []byte) (probers.Configurer, error)
UnmarshalSettings constructs a DNSConf object from YAML as bytes.
DNSProbe is the exported 'Prober' object for monitors configured to perform DNS requests.
type DNSProbe struct {
// contains filtered or unexported fields
}
func (p DNSProbe) Kind() string
Kind returns a name that uniquely identifies the `Kind` of `Prober`.
func (p DNSProbe) Name() string
Name returns a string that uniquely identifies the monitor.
func (p DNSProbe) Probe(timeout time.Duration) (bool, time.Duration)
Probe performs the configured DNS query.