Compare commits
2 commits
f747d71cc0
...
9382391c30
Author | SHA1 | Date | |
---|---|---|---|
Gabriel Simmer | 9382391c30 | ||
Gabriel Simmer | 5107e16233 |
|
@ -159,9 +159,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) {
|
|||
"servers.bind.",
|
||||
}
|
||||
|
||||
responses := make([]dns.RR, len(questions))
|
||||
|
||||
for i, q := range questions {
|
||||
for _, q := range questions {
|
||||
msg := &dns.Msg{
|
||||
MsgHdr: dns.MsgHdr{
|
||||
Id: dns.Id(),
|
||||
|
@ -177,10 +175,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) {
|
|||
return err
|
||||
}
|
||||
|
||||
responses[i] = in.Answer[0]
|
||||
}
|
||||
|
||||
for _, a := range responses {
|
||||
for _, a := range in.Answer {
|
||||
txt, ok := a.(*dns.TXT)
|
||||
if !ok {
|
||||
continue
|
||||
|
@ -218,6 +213,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) {
|
|||
ch <- prometheus.MustNewConstMetric(g, prometheus.GaugeValue, f)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ import (
|
|||
"github.com/google/dnsmasq_exporter/collector"
|
||||
"github.com/miekg/dns"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"github.com/prometheus/client_golang/prometheus/collectors/version"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
Loading…
Reference in a new issue