diff --git a/bind/bind.go b/bind/bind.go index b8fe9d4..6981216 100644 --- a/bind/bind.go +++ b/bind/bind.go @@ -136,7 +136,7 @@ type Counter struct { // Counter represents a single zone counter value. type ZoneCounter struct { Name string - Serial uint64 + Serial string } // Gauge represents a single gauge value. diff --git a/bind/v2/v2.go b/bind/v2/v2.go index b872018..a7929dc 100644 --- a/bind/v2/v2.go +++ b/bind/v2/v2.go @@ -59,7 +59,7 @@ type View struct { type Zone struct { Name string `xml:"name"` Rdataclass string `xml:"rdataclass"` - Serial uint64 `xml:"serial"` + Serial string `xml:"serial"` } type Counter struct { diff --git a/bind/v3/v3.go b/bind/v3/v3.go index b78f292..e85d945 100644 --- a/bind/v3/v3.go +++ b/bind/v3/v3.go @@ -80,7 +80,7 @@ type Counter struct { type ZoneCounter struct { Name string `xml:"name,attr"` Rdataclass string `xml:"rdataclass,attr"` - Serial uint64 `xml:"serial"` + Serial string `xml:"serial"` } // Client implements bind.Client and can be used to query a BIND v3 API. diff --git a/bind_exporter.go b/bind_exporter.go index de85c80..2ef43e0 100644 --- a/bind_exporter.go +++ b/bind_exporter.go @@ -337,9 +337,11 @@ func (c *viewCollector) Collect(ch chan<- prometheus.Metric) { for _, v := range c.stats.ZoneViews { for _, z := range v.ZoneData { - ch <- prometheus.MustNewConstMetric( - zoneSerial, prometheus.CounterValue, float64(z.Serial), v.Name, z.Name, - ) + if suint, err := strconv.ParseUint(z.Serial, 10, 64); err == nil { + ch <- prometheus.MustNewConstMetric( + zoneSerial, prometheus.CounterValue, float64(suint), v.Name, z.Name, + ) + } } } }