mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 10:43:17 -04:00
Add complete secondary support
Respond to notifies and allow a secondary to follow the SOA parameters to update a zone from a primary. Also sprinkle it with logging. Also extend monitoring to include qtype in more metrics.
This commit is contained in:
@@ -25,9 +25,9 @@ func (m *Metrics) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
|
||||
status, err := m.Next.ServeDNS(ctx, rw, r)
|
||||
|
||||
requestCount.WithLabelValues(zone, qtype).Inc()
|
||||
requestDuration.WithLabelValues(zone).Observe(float64(time.Since(rw.Start()) / time.Second))
|
||||
responseSize.WithLabelValues(zone).Observe(float64(rw.Size()))
|
||||
responseRcode.WithLabelValues(zone, strconv.Itoa(rw.Rcode())).Inc()
|
||||
requestDuration.WithLabelValues(zone, qtype).Observe(float64(time.Since(rw.Start()) / time.Second))
|
||||
responseSize.WithLabelValues(zone, qtype).Observe(float64(rw.Size()))
|
||||
responseRcode.WithLabelValues(zone, strconv.Itoa(rw.Rcode()), qtype).Inc()
|
||||
|
||||
return status, err
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ func define(subsystem string) {
|
||||
Namespace: namespace,
|
||||
Subsystem: subsystem,
|
||||
Name: "request_count_total",
|
||||
Help: "Counter of DNS requests made per zone and type.",
|
||||
Help: "Counter of DNS requests made per zone and type and opcode.",
|
||||
}, []string{"zone", "qtype"})
|
||||
|
||||
requestDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
|
||||
@@ -61,7 +61,7 @@ func define(subsystem string) {
|
||||
Subsystem: subsystem,
|
||||
Name: "request_duration_seconds",
|
||||
Help: "Histogram of the time (in seconds) each request took.",
|
||||
}, []string{"zone"})
|
||||
}, []string{"zone", "qtype"})
|
||||
|
||||
responseSize = prometheus.NewHistogramVec(prometheus.HistogramOpts{
|
||||
Namespace: namespace,
|
||||
@@ -69,12 +69,12 @@ func define(subsystem string) {
|
||||
Name: "response_size_bytes",
|
||||
Help: "Size of the returns response in bytes.",
|
||||
Buckets: []float64{0, 100, 200, 300, 400, 511, 1023, 2047, 4095, 8291, 16e3, 32e3, 48e3, 64e3},
|
||||
}, []string{"zone"})
|
||||
}, []string{"zone", "qtype"})
|
||||
|
||||
responseRcode = prometheus.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: namespace,
|
||||
Subsystem: subsystem,
|
||||
Name: "response_rcode_count_total",
|
||||
Help: "Counter of response status codes.",
|
||||
}, []string{"zone", "rcode"})
|
||||
}, []string{"zone", "rcode", "qtype"})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user