Documentation ¶
Overview ¶
Package metrics implement a handler and plugin that provides Prometheus metrics.
Index ¶
- Variables
- type Metrics
- func (m *Metrics) AddZone(z string)
- func (m *Metrics) MustRegister(c prometheus.Collector)
- func (m *Metrics) Name() string
- func (m *Metrics) OnShutdown() error
- func (m *Metrics) OnStartup() error
- func (m *Metrics) RemoveZone(z string)
- func (m *Metrics) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)
- func (m *Metrics) ZoneNames() []string
Constants ¶
This section is empty.
Variables ¶
View Source
var ListenAddr string
ListenAddr is assigned the address of the prometheus listener. Its use is mainly in tests where we listen on "localhost:0" and need to retrieve the actual address.
Functions ¶
This section is empty.
Types ¶
type Metrics ¶
type Metrics struct { Next plugin.Handler Addr string Reg *prometheus.Registry // contains filtered or unexported fields }
Metrics holds the prometheus configuration. The metrics' path is fixed to be /metrics
func (*Metrics) MustRegister ¶ added in v1.0.3
func (m *Metrics) MustRegister(c prometheus.Collector)
MustRegister wraps m.Reg.MustRegister.
func (*Metrics) OnShutdown ¶
OnShutdown tears down the metrics on shutdown and restart.
func (*Metrics) RemoveZone ¶
RemoveZone remove zone z from m.
Click to show internal directories.
Click to hide internal directories.