Repository: nshttpd/mikrotik-exporter

Issue:
Netwatch status missing for hosts that do not have `disabled` field set
I am using `mikrotik-exporter` to collect metrics from a RB4011iGS+5HacQ2HnD router running RouterOS 7.4.

When I add a new netwatch host, its status does not get exported:
```
$ ssh 10.11.12.1 '/tool/netwatch add host=1.1.1.1'
$ curl -s localhost:11223/metrics | grep 1.1.1.1
$ 
```

Explicitly setting `disabled=no` fixes this:
```
$ ssh 10.11.12.1 '/tool/netwatch set disabled=no [find host=1.1.1.1]'
$ curl -s localhost:11223/metrics | grep 1.1.1.1
mikrotik_netwatch_status{address="10.11.12.1",comment="",host="1.1.1.1",name="router"} 1
$
```

It seems that [?disabled=false](https://github.com/nshttpd/mikrotik-exporter/blob/e1b06c6ebe6e71a5661326b3a33afe2fd741283d/collector/netwatch_collector.go#L52) condition does not hold true if `disabled` field is not set at all. Is this expected?

Silently omitting data from exported metrics does not seem like a great default. Would it make sense to remove the `?disabled=false` condition while querying data via the API and either exclude disabled hosts in the exporter, or maybe just expose `disabled` as a separate metric label?

I will be happy to prepare a PR for this.

Hints from issue comments:

Solution patch:
diff --git a/README.md b/README.md
index 8f150be..4f470ac 100644
--- a/README.md
+++ b/README.md
@@ -65,6 +65,7 @@ devices:
     port: 8999
     user: prometheus2
     password: password_to_second_router
+    wifiwave2: true
   - name: routers_srv_dns
     srv:
       record: _mikrotik._udp.example.com
@@ -87,12 +88,18 @@ features:
   routes: true
   pools: true
   optics: true
+  wlanif: true
+  wlansta: true
 ```
 
 If you add a devices with the `srv` parameter instead of `address` the exporter will perform a DNS query
 to obtain the SRV record and discover the devices dynamically. Also, you can specify a DNS server to use
 on the query.
 
+Use the option `wifiwave2: true` for devices that have the `wifiwave2` package,
+which replaces the `wireless` implementation, installed. This is necessary as `wifiwave2` has a slightly
+different API and exposes a slightly smaller set of attributes (for example, no signal-to-noise, etc.)
+
 
 ###### example output
 
diff --git a/collector/cloud_collector.go b/collector/cloud_collector.go
new file mode 100644
index 0000000..5991f88
--- /dev/null
+++ b/collector/cloud_collector.go
@@ -0,0 +1,93 @@
+package collector
+
+import (
+	"fmt"
+	"strings"
+
+	"github.com/prometheus/client_golang/prometheus"
+	log "github.com/sirupsen/logrus"
+	"gopkg.in/routeros.v2/proto"
+)
+
+type cloudCollector struct {
+	props        []string
+	descriptions map[string]*prometheus.Desc
+}
+
+func newCloudCollector() routerOSCollector {
+	c := &cloudCollector{}
+	c.init()
+	return c
+}
+
+func (c *cloudCollector) init() {
+	c.props = []string{"public-address", "ddns-enabled"}
+	labelNames := []string{"name", "address", "public_address"}
+	c.descriptions = make(map[string]*prometheus.Desc)
+	for _, p := range c.props[1:] {
+		c.descriptions[p] = descriptionForPropertyName("cloud", p, labelNames)
+	}
+}
+
+func (c *cloudCollector) describe(ch chan<- *prometheus.Desc) {
+	for _, d := range c.descriptions {
+		ch <- d
+	}
+}
+
+func (c *cloudCollector) collect(ctx *collectorContext) error {
+	stats, err := c.fetch(ctx)
+	if err != nil {
+		return err
+	}
+
+	for _, re := range stats {
+		c.collectForStat(re, ctx)
+	}
+
+	return nil
+}
+
+func (c *cloudCollector) fetch(ctx *collectorContext) ([]*proto.Sentence, error) {
+	reply, err := ctx.client.Run("/ip/cloud/print", "=.proplist="+strings.Join(c.props, ","))
+	if err != nil {
+		log.WithFields(log.Fields{
+			"device": ctx.device.Name,
+			"error":  err,
+		}).Error("error fetching cloud metrics")
+		return nil, err
+	}
+
+	return reply.Re, nil
+}
+
+func (c *cloudCollector) collectForStat(re *proto.Sentence, ctx *collectorContext) {
+	publicIp := re.Map["public-address"]
+
+	for _, p := range c.props[1:] {
+		c.collectMetricForProperty(p, publicIp, re, ctx)
+	}
+}
+
+func (c *cloudCollector) collectMetricForProperty(property, publicIp string, re *proto.Sentence, ctx *collectorContext) {
+	desc := c.descriptions[property]
+	if value := re.Map[property]; value != "" {
+		var numericValue float64
+		switch value {
+		case "false":
+			numericValue = 0
+		case "true":
+			numericValue = 1
+		default:
+			log.WithFields(log.Fields{
+				"device":         ctx.device.Name,
+				"public-address": publicIp,
+				"property":       property,
+				"value":          value,
+				"error":          fmt.Errorf("unexpected cloud ddns-enabled value"),
+			}).Error("error parsing cloud metric value")
+		}
+
+		ctx.ch <- prometheus.MustNewConstMetric(desc, prometheus.CounterValue, numericValue, ctx.device.Name, ctx.device.Address, publicIp)
+	}
+}
diff --git a/collector/collector.go b/collector/collector.go
index 61e7c3c..6300a1d 100644
--- a/collector/collector.go
+++ b/collector/collector.go
@@ -203,6 +203,13 @@ func WithNetwatch() Option {
 	}
 }
 
+// WithCloud enables cloud service metrics
+func WithCloud() Option {
+	return func(c *collector) {
+		c.collectors = append(c.collectors, newCloudCollector())
+	}
+}
+
 // Option applies options to collector
 type Option func(*collector)
 
@@ -354,7 +361,7 @@ func (c *collector) connectAndCollect(d *config.Device, ch chan<- prometheus.Met
 		ctx := &collectorContext{ch, d, cl}
 		err = co.collect(ctx)
 		if err != nil {
-			return err
+			log.Error("error collecting metrics")
 		}
 	}
 
diff --git a/collector/lte_collector.go b/collector/lte_collector.go
index 4baf6f6..4d30b65 100644
--- a/collector/lte_collector.go
+++ b/collector/lte_collector.go
@@ -22,7 +22,7 @@ func newLteCollector() routerOSCollector {
 }
 
 func (c *lteCollector) init() {
-	c.props = []string{"current-cellid", "primary-band" ,"ca-band", "rssi", "rsrp", "rsrq", "sinr"}
+	c.props = []string{"current-cellid", "primary-band", "ca-band", "rssi", "rsrp", "rsrq", "sinr", "lac", "sector-id", "phy-cellid", "cqi", "session-uptime"}
 	labelNames := []string{"name", "address", "interface", "cellid", "primaryband", "caband"}
 	c.descriptions = make(map[string]*prometheus.Desc)
 	for _, p := range c.props {
@@ -106,16 +106,31 @@ func (c *lteCollector) collectMetricForProperty(property, iface string, re *prot
 	if re.Map[property] == "" {
 		return
 	}
-	v, err := strconv.ParseFloat(re.Map[property], 64)
-	if err != nil {
-		log.WithFields(log.Fields{
-			"property":  property,
-			"interface": iface,
-			"device":    ctx.device.Name,
-			"error":     err,
-		}).Error("error parsing interface metric value")
+
+	if property == "session-uptime" {
+		v, err := parseDuration(re.Map[property])
+		if err != nil {
+			log.WithFields(log.Fields{
+				"property":  property,
+				"interface": iface,
+				"device":    ctx.device.Name,
+				"error":     err,
+			}).Error("error parsing interface duration metric value")
+			return
+		}
+		ctx.ch <- prometheus.MustNewConstMetric(desc, prometheus.CounterValue, v, ctx.device.Name, ctx.device.Address, iface, current_cellid, primaryband, caband)
 		return
+	} else {
+		v, err := strconv.ParseFloat(re.Map[property], 64)
+		if err != nil {
+			log.WithFields(log.Fields{
+				"property":  property,
+				"interface": iface,
+				"device":    ctx.device.Name,
+				"error":     err,
+			}).Error("error parsing interface metric value")
+			return
+		}
+		ctx.ch <- prometheus.MustNewConstMetric(desc, prometheus.GaugeValue, v, ctx.device.Name, ctx.device.Address, iface, current_cellid, primaryband, caband)
 	}
-
-	ctx.ch <- prometheus.MustNewConstMetric(desc, prometheus.GaugeValue, v, ctx.device.Name, ctx.device.Address, iface, current_cellid, primaryband, caband)
 }
diff --git a/collector/netwatch_collector.go b/collector/netwatch_collector.go
index 2a9fcb0..9f12285 100644
--- a/collector/netwatch_collector.go
+++ b/collector/netwatch_collector.go
@@ -21,10 +21,10 @@ func newNetwatchCollector() routerOSCollector {
 }
 
 func (c *netwatchCollector) init() {
-	c.props = []string{"host", "comment", "status"}
-	labelNames := []string{"name", "address", "host", "comment"}
+	c.props = []string{"host", "comment", "disabled", "status"}
+	labelNames := []string{"name", "address", "host", "comment", "disabled"}
 	c.descriptions = make(map[string]*prometheus.Desc)
-	for _, p := range c.props[1:] {
+	for _, p := range c.props[3:] {
 		c.descriptions[p] = descriptionForPropertyName("netwatch", p, labelNames)
 	}
 }
@@ -49,7 +49,7 @@ func (c *netwatchCollector) collect(ctx *collectorContext) error {
 }
 
 func (c *netwatchCollector) fetch(ctx *collectorContext) ([]*proto.Sentence, error) {
-	reply, err := ctx.client.Run("/tool/netwatch/print", "?disabled=false", "=.proplist="+strings.Join(c.props, ","))
+	reply, err := ctx.client.Run("/tool/netwatch/print", "=.proplist="+strings.Join(c.props, ","))
 	if err != nil {
 		log.WithFields(log.Fields{
 			"device": ctx.device.Name,
@@ -64,13 +64,14 @@ func (c *netwatchCollector) fetch(ctx *collectorContext) ([]*proto.Sentence, err
 func (c *netwatchCollector) collectForStat(re *proto.Sentence, ctx *collectorContext) {
 	host := re.Map["host"]
 	comment := re.Map["comment"]
+	disabled := re.Map["disabled"]
 
-	for _, p := range c.props[2:] {
-		c.collectMetricForProperty(p, host, comment, re, ctx)
+	for _, p := range c.props[3:] {
+		c.collectMetricForProperty(p, host, comment, disabled, re, ctx)
 	}
 }
 
-func (c *netwatchCollector) collectMetricForProperty(property, host, comment string, re *proto.Sentence, ctx *collectorContext) {
+func (c *netwatchCollector) collectMetricForProperty(property, host, comment, disabled string, re *proto.Sentence, ctx *collectorContext) {
 	desc := c.descriptions[property]
 	if value := re.Map[property]; value != "" {
 		var numericValue float64
@@ -90,6 +91,6 @@ func (c *netwatchCollector) collectMetricForProperty(property, host, comment str
 				"error":    fmt.Errorf("unexpected netwatch status value"),
 			}).Error("error parsing netwatch metric value")
 		}
-		ctx.ch <- prometheus.MustNewConstMetric(desc, prometheus.CounterValue, numericValue, ctx.device.Name, ctx.device.Address, host, comment)
+		ctx.ch <- prometheus.MustNewConstMetric(desc, prometheus.CounterValue, numericValue, ctx.device.Name, ctx.device.Address, host, comment, disabled)
 	}
 }
diff --git a/collector/wlanif_collector.go b/collector/wlanif_collector.go
index 491d1c7..7167ec0 100644
--- a/collector/wlanif_collector.go
+++ b/collector/wlanif_collector.go
@@ -11,8 +11,9 @@ import (
 )
 
 type wlanIFCollector struct {
-	props        []string
-	descriptions map[string]*prometheus.Desc
+	props          []string
+	propsWifiwave2 []string
+	descriptions   map[string]*prometheus.Desc
 }
 
 func newWlanIFCollector() routerOSCollector {
@@ -23,11 +24,15 @@ func newWlanIFCollector() routerOSCollector {
 
 func (c *wlanIFCollector) init() {
 	c.props = []string{"channel", "registered-clients", "noise-floor", "overall-tx-ccq"}
+	// wifiwave2 has slightly different names
+	c.propsWifiwave2 = []string{"channel", "registered-peers"}
 	labelNames := []string{"name", "address", "interface", "channel"}
 	c.descriptions = make(map[string]*prometheus.Desc)
 	for _, p := range c.props {
 		c.descriptions[p] = descriptionForPropertyName("wlan_interface", p, labelNames)
 	}
+	// add description for wifiwave2-specific properties to map to wireless ones
+	c.descriptions["registered-peers"] = descriptionForPropertyName("wlan_interface", "registered-clients", labelNames)
 }
 
 func (c *wlanIFCollector) describe(ch chan<- *prometheus.Desc) {
@@ -53,7 +58,13 @@ func (c *wlanIFCollector) collect(ctx *collectorContext) error {
 }
 
 func (c *wlanIFCollector) fetchInterfaceNames(ctx *collectorContext) ([]string, error) {
-	reply, err := ctx.client.Run("/interface/wireless/print", "?disabled=false", "=.proplist=name")
+	cmd := ""
+	if ctx.device.Wifiwave2 {
+		cmd = "/interface/wifiwave/print"
+	} else {
+		cmd = "/interface/wireless/print"
+	}
+	reply, err := ctx.client.Run(cmd, "?disabled=false", "=.proplist=name")
 	if err != nil {
 		log.WithFields(log.Fields{
 			"device": ctx.device.Name,
@@ -71,7 +82,16 @@ func (c *wlanIFCollector) fetchInterfaceNames(ctx *collectorContext) ([]string,
 }
 
 func (c *wlanIFCollector) collectForInterface(iface string, ctx *collectorContext) error {
-	reply, err := ctx.client.Run("/interface/wireless/monitor", fmt.Sprintf("=numbers=%s", iface), "=once=", "=.proplist="+strings.Join(c.props, ","))
+	cmd := ""
+	var props []string
+	if ctx.device.Wifiwave2 {
+		cmd = "/interface/wifiwave/monitor"
+		props = c.propsWifiwave2
+	} else {
+		cmd = "/interface/wireless/monitor"
+		props = c.props
+	}
+	reply, err := ctx.client.Run(cmd, fmt.Sprintf("=numbers=%s", iface), "=once=", "=.proplist="+strings.Join(props, ","))
 	if err != nil {
 		log.WithFields(log.Fields{
 			"interface": iface,
@@ -81,7 +101,7 @@ func (c *wlanIFCollector) collectForInterface(iface string, ctx *collectorContex
 		return err
 	}
 
-	for _, p := range c.props[1:] {
+	for _, p := range props[1:] {
 		// there's always going to be only one sentence in reply, as we
 		// have to explicitly specify the interface
 		c.collectMetricForProperty(p, iface, reply.Re[0], ctx)
diff --git a/collector/wlansta_collector.go b/collector/wlansta_collector.go
index 0471571..411af8a 100644
--- a/collector/wlansta_collector.go
+++ b/collector/wlansta_collector.go
@@ -9,9 +9,20 @@ import (
 	"gopkg.in/routeros.v2/proto"
 )
 
+// from https://forum.mikrotik.com/viewtopic.php?t=195124#p999722:
+// wifiwave2 is an implementation of drivers from the manufacturer of the
+// chipset, rather than an in-house written driver (which wireless is). So
+// there are many small details that are missing or incomplete...
+
 type wlanSTACollector struct {
-	props        []string
-	descriptions map[string]*prometheus.Desc
+	// Both wifiwave2 and wireless have a similar, yet different API. They also
+	// expose a slightly different set of properties.
+	props               []string
+	propsWirelessExtra  []string
+	propsWirelessRXTX   []string
+	propsWifiwave2Extra []string
+	propsWifiwave2RXTX  []string
+	descriptions        map[string]*prometheus.Desc
 }
 
 func newWlanSTACollector() routerOSCollector {
@@ -21,13 +32,28 @@ func newWlanSTACollector() routerOSCollector {
 }
 
 func (c *wlanSTACollector) init() {
-	c.props = []string{"interface", "mac-address", "signal-to-noise", "signal-strength", "packets", "bytes", "frames"}
+	// common properties
+	c.props = []string{"interface", "mac-address"}
+	// wifiwave2 doesn't expose SNR, and uses different name for signal-strength
+	c.propsWirelessExtra = []string{"signal-to-noise", "signal-strength"}
+	// wireless exposes extra field "frames", not available in wifiwave2
+	c.propsWirelessRXTX = []string{"packets", "bytes", "frames"}
+	c.propsWifiwave2Extra = []string{"signal"}
+	c.propsWifiwave2RXTX = []string{"packets", "bytes"}
+	// all metrics have the same label names
 	labelNames := []string{"name", "address", "interface", "mac_address"}
 	c.descriptions = make(map[string]*prometheus.Desc)
-	for _, p := range c.props[:len(c.props)-3] {
+	for _, p := range c.propsWirelessExtra {
 		c.descriptions[p] = descriptionForPropertyName("wlan_station", p, labelNames)
 	}
-	for _, p := range c.props[len(c.props)-3:] {
+	// normalize the metric name 'signal-strength' for the property "signal", so that dashboards
+	// that capture both wireless and wifiwave2 devices don't need to normalize
+	c.descriptions["signal"] = descriptionForPropertyName("wlan_station", "signal-strength", labelNames)
+	for _, p := range c.propsWirelessRXTX {
+		c.descriptions["tx_"+p] = descriptionForPropertyName("wlan_station", "tx_"+p, labelNames)
+		c.descriptions["rx_"+p] = descriptionForPropertyName("wlan_station", "rx_"+p, labelNames)
+	}
+	for _, p := range c.propsWifiwave2RXTX {
 		c.descriptions["tx_"+p] = descriptionForPropertyName("wlan_station", "tx_"+p, labelNames)
 		c.descriptions["rx_"+p] = descriptionForPropertyName("wlan_station", "rx_"+p, labelNames)
 	}
@@ -53,7 +79,24 @@ func (c *wlanSTACollector) collect(ctx *collectorContext) error {
 }
 
 func (c *wlanSTACollector) fetch(ctx *collectorContext) ([]*proto.Sentence, error) {
-	reply, err := ctx.client.Run("/interface/wireless/registration-table/print", "=.proplist="+strings.Join(c.props, ","))
+	var cmd []string
+	var props []string = c.props
+	if ctx.device.Wifiwave2 {
+		props = append(props, c.propsWifiwave2Extra...)
+		props = append(props, c.propsWifiwave2RXTX...)
+		cmd = []string{
+			"/interface/wifiwave2/registration-table/print",
+			"=.proplist=" + strings.Join(props, ","),
+		}
+	} else {
+		props = append(props, c.propsWirelessExtra...)
+		props = append(props, c.propsWirelessRXTX...)
+		cmd = []string{
+			"/interface/wireless/registration-table/print",
+			"=.proplist=" + strings.Join(props, ","),
+		}
+	}
+	reply, err := ctx.client.Run(cmd...)
 	if err != nil {
 		log.WithFields(log.Fields{
 			"device": ctx.device.Name,
@@ -69,11 +112,20 @@ func (c *wlanSTACollector) collectForStat(re *proto.Sentence, ctx *collectorCont
 	iface := re.Map["interface"]
 	mac := re.Map["mac-address"]
 
-	for _, p := range c.props[2 : len(c.props)-3] {
-		c.collectMetricForProperty(p, iface, mac, re, ctx)
-	}
-	for _, p := range c.props[len(c.props)-3:] {
-		c.collectMetricForTXRXCounters(p, iface, mac, re, ctx)
+	if ctx.device.Wifiwave2 {
+		for _, p := range c.propsWifiwave2Extra {
+			c.collectMetricForProperty(p, iface, mac, re, ctx)
+		}
+		for _, p := range c.propsWifiwave2RXTX {
+			c.collectMetricForTXRXCounters(p, iface, mac, re, ctx)
+		}
+	} else {
+		for _, p := range c.propsWirelessExtra {
+			c.collectMetricForProperty(p, iface, mac, re, ctx)
+		}
+		for _, p := range c.propsWirelessRXTX {
+			c.collectMetricForTXRXCounters(p, iface, mac, re, ctx)
+		}
 	}
 }
 
diff --git a/config/config.go b/config/config.go
index 7905d25..c28be6b 100644
--- a/config/config.go
+++ b/config/config.go
@@ -30,17 +30,19 @@ type Config struct {
 		Ipsec     bool `yaml:"ipsec,omitempty"`
 		Lte       bool `yaml:"lte,omitempty"`
 		Netwatch  bool `yaml:"netwatch,omitempty"`
+		Cloud     bool `yaml:"netwatch,omitempty"`
 	} `yaml:"features,omitempty"`
 }
 
 // Device represents a target device
 type Device struct {
-	Name     string    `yaml:"name"`
-	Address  string    `yaml:"address,omitempty"`
-	Srv      SrvRecord `yaml:"srv,omitempty"`
-	User     string    `yaml:"user"`
-	Password string    `yaml:"password"`
-	Port     string    `yaml:"port"`
+	Name      string    `yaml:"name"`
+	Address   string    `yaml:"address,omitempty"`
+	Srv       SrvRecord `yaml:"srv,omitempty"`
+	User      string    `yaml:"user"`
+	Password  string    `yaml:"password"`
+	Port      string    `yaml:"port"`
+	Wifiwave2 bool      `yaml:"wifiwave2"`
 }
 
 type SrvRecord struct {
diff --git a/config/config.test.yml b/config/config.test.yml
index 753d44d..23ffde1 100644
--- a/config/config.test.yml
+++ b/config/config.test.yml
@@ -22,3 +22,4 @@ features:
   ipsec: true
   lte: true
   netwatch: true
+  cloud: true
diff --git a/go.mod b/go.mod
index 965b2d9..b516599 100644
--- a/go.mod
+++ b/go.mod
@@ -1,15 +1,33 @@
 module mikrotik-exporter
 
-go 1.13
+go 1.24.0
 
 require (
-	github.com/miekg/dns v1.1.43
-	github.com/prometheus/client_golang v1.4.1
-	github.com/prometheus/common v0.9.1
-	github.com/sirupsen/logrus v1.8.1
-	github.com/stretchr/testify v1.4.0
-	golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect
-	golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e // indirect
+	github.com/miekg/dns v1.1.68
+	github.com/prometheus/client_golang v1.23.2
+	github.com/prometheus/common v0.66.1
+	github.com/sirupsen/logrus v1.9.3
+	github.com/stretchr/testify v1.11.1
 	gopkg.in/routeros.v2 v2.0.0-20190905230420-1bbf141cdd91
 	gopkg.in/yaml.v2 v2.4.0
 )
+
+require (
+	github.com/beorn7/perks v1.0.1 // indirect
+	github.com/cespare/xxhash/v2 v2.3.0 // indirect
+	github.com/davecgh/go-spew v1.1.1 // indirect
+	github.com/golang/protobuf v1.5.4 // indirect
+	github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
+	github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
+	github.com/pmezard/go-difflib v1.0.0 // indirect
+	github.com/prometheus/client_model v0.6.2 // indirect
+	github.com/prometheus/procfs v0.17.0 // indirect
+	go.yaml.in/yaml/v2 v2.4.3 // indirect
+	golang.org/x/mod v0.28.0 // indirect
+	golang.org/x/net v0.44.0 // indirect
+	golang.org/x/sync v0.17.0 // indirect
+	golang.org/x/sys v0.36.0 // indirect
+	golang.org/x/tools v0.37.0 // indirect
+	google.golang.org/protobuf v1.36.10 // indirect
+	gopkg.in/yaml.v3 v3.0.1 // indirect
+)
diff --git a/go.sum b/go.sum
index 20c6f18..f92cc5e 100644
--- a/go.sum
+++ b/go.sum
@@ -1,118 +1,206 @@
+cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
 github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
 github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
 github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
 github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
 github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
 github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
+github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
 github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
+github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
 github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
 github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
+github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
+github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
 github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
+github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
 github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
-github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
+github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
+github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
 github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
+github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
 github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
 github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
 github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
 github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
 github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
 github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
 github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
 github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
 github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
+github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
+github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
 github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg=
 github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
+github.com/miekg/dns v1.1.68 h1:jsSRkNozw7G/mnmXULynzMNIsgY2dHC8LO6U6Ij2JEA=
+github.com/miekg/dns v1.1.68/go.mod h1:fujopn7TB3Pu3JM69XaawiU0wqjpL9/8xGop5UrTPps=
 github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
 github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
 github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
+github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
 github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
-github.com/prometheus/client_golang v1.4.1 h1:FFSuS004yOQEtDdTq+TAOLP5xUq63KqAFYyOi8zA+Y8=
-github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
+github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
+github.com/prometheus/client_golang v1.11.1 h1:+4eQaD7vAZ6DsfsxB15hbE0odUjGI5ARs9yskGu1v4s=
+github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
+github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
+github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
 github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
 github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
 github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
+github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
 github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U=
-github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
+github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
+github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ=
+github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
+github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs=
+github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA=
 github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
 github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
-github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8=
-github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
+github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
+github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4=
+github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
+github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0=
+github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=
 github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
+github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
 github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
 github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
+github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
+github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
 github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
 github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
+github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
+go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
+go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
 golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U=
+golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
 golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI=
 golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I=
+golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
+golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
+golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
 golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e h1:WUoyKPm6nCo1BnNUvPGnFG3T5DUVem42yDJZZ4CNxMA=
-golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
+golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
+golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE=
+golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.26.0-rc.1 h1:7QnIQpGRHE5RnLKnESfDoxm2dTapTZua5a0kS0A+VXQ=
+google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
+google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
+google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
 gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
 gopkg.in/routeros.v2 v2.0.0-20190905230420-1bbf141cdd91 h1:RqTijcxlh3kwSEx4M1YfVoIBgA6rFO632PIOIjXAbz4=
 gopkg.in/routeros.v2 v2.0.0-20190905230420-1bbf141cdd91/go.mod h1:dXYL5YdVb9GEWLoWK8VHdwL/SuFrNyb/hj2/CXZVT7E=
 gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c=
 gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
 gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/main.go b/main.go
index f6596b8..96fe690 100644
--- a/main.go
+++ b/main.go
@@ -6,7 +6,7 @@ import (
 	"io/ioutil"
 	"os"
 
-	"github.com/prometheus/common/version"
+	
 
 	"fmt"
 	"net/http"
@@ -55,6 +55,7 @@ var (
 	withIpsec     = flag.Bool("with-ipsec", false, "retrieves ipsec metrics")
 	withLte       = flag.Bool("with-lte", false, "retrieves lte metrics")
 	withNetwatch  = flag.Bool("with-netwatch", false, "retrieves netwatch metrics")
+	withCloud     = flag.Bool("with-cloud", false, "retrives cloud services stats")
 
 	cfg *config.Config
 
@@ -62,13 +63,25 @@ var (
 	shortSha   = "0xDEADBEEF"
 )
 
+var (
+	buildInfo = prometheus.NewGaugeVec(
+		prometheus.GaugeOpts{
+			Name: "mikrotik_exporter_build_info",
+			Help: "A metric with a constant '1' value labeled with version, revision, and build date of the application.",
+		},
+		[]string{"version", "short_sha"},
+	)
+)
+
 func init() {
-	prometheus.MustRegister(version.NewCollector("mikrotik_exporter"))
+	prometheus.MustRegister(buildInfo)
 }
 
 func main() {
 	flag.Parse()
 
+	buildInfo.WithLabelValues(appVersion, shortSha).Set(1)
+
 	if *ver {
 		fmt.Printf("\nVersion:   %s\nShort SHA: %s\n\n", appVersion, shortSha)
 		os.Exit(0)
@@ -274,6 +287,10 @@ func collectorOptions() []collector.Option {
 		opts = append(opts, collector.WithNetwatch())
 	}
 
+	if *withCloud || cfg.Features.Cloud {
+		opts = append(opts, collector.WithCloud())
+	}
+
 	if *timeout != collector.DefaultTimeout {
 		opts = append(opts, collector.WithTimeout(*timeout))
 	}



Test patch:
diff --git a/collector/cloud_collector_test.go b/collector/cloud_collector_test.go
new file mode 100644
index 0000000..098ad6e
--- /dev/null
+++ b/collector/cloud_collector_test.go
@@ -0,0 +1,163 @@
+package collector
+
+import (
+	"io"
+	"mikrotik-exporter/config"
+	"testing"
+
+	"github.com/prometheus/client_golang/prometheus"
+	dto "github.com/prometheus/client_model/go"
+	"github.com/stretchr/testify/assert"
+	routeros "gopkg.in/routeros.v2"
+	"gopkg.in/routeros.v2/proto"
+)
+
+func TestCloudMetricDesc(t *testing.T) {
+	c := getFakeClient(t, "false")
+	defer c.Close()
+
+	cloudCollector := newCloudCollector()
+	metrics := make(chan prometheus.Metric, 1)
+
+	ctx := collectorContext{
+		ch:     metrics,
+		device: &config.Device{Name: "foo", Address: "test"},
+		client: c,
+	}
+
+	cloudCollector.collect(&ctx)
+	m := <-metrics
+
+	d := descriptionForPropertyName("cloud", "ddns-enabled", []string{"name", "address", "public_address"})
+
+	assert.Equal(t, d, m.Desc(), "metrics description missmatch")
+}
+
+func TestCloudCollectFalse(t *testing.T) {
+	var pb dto.Metric
+
+	c := getFakeClient(t, "false")
+	defer c.Close()
+
+	cloudCollector := newCloudCollector()
+	metrics := make(chan prometheus.Metric, 1)
+
+	ctx := collectorContext{
+		ch:     metrics,
+		device: &config.Device{Name: "foo", Address: "test"},
+		client: c,
+	}
+
+	cloudCollector.collect(&ctx)
+	m := <-metrics
+
+	assert.NoError(t, nil, m.Write(&pb), "error reading metrics")
+	assert.Equal(t, float64(0), pb.Counter.GetValue(), "excpeted output should be 0 for false")
+
+	for _, l := range pb.Label {
+		switch l.GetName() {
+		case "name":
+			assert.Equal(t, "foo", l.GetValue(), "device name label value missmatch")
+		case "address":
+			assert.Equal(t, "test", l.GetValue(), "device address label value missmatch")
+		case "public_address":
+			assert.Equal(t, "0.0.0.0", l.GetValue(), "public_address label value missmatch")
+		default:
+			t.Fatalf("invalid or missing lables %s", l.GetName())
+		}
+	}
+}
+
+func TestCloudCollectTrue(t *testing.T) {
+	var pb dto.Metric
+
+	c := getFakeClient(t, "true")
+	defer c.Close()
+
+	cloudCollector := newCloudCollector()
+	metrics := make(chan prometheus.Metric, 1)
+
+	ctx := collectorContext{
+		ch:     metrics,
+		device: &config.Device{Name: "foo", Address: "test"},
+		client: c,
+	}
+
+	cloudCollector.collect(&ctx)
+	m := <-metrics
+
+	assert.NoError(t, nil, m.Write(&pb))
+	assert.Equal(t, float64(1), pb.Counter.GetValue(), "excpeted output should be 1 for true")
+}
+
+func getFakeClient(t *testing.T, state string) *routeros.Client {
+	c, s := newPair(t)
+
+	go func() {
+		defer s.Close()
+		s.readSentence(t, "/ip/cloud/print @ [{`.proplist` `public-address,ddns-enabled`}]")
+		s.writeSentence(t, "!re", "=ddns-enabled="+state, "=public-address=0.0.0.0")
+		s.writeSentence(t, "!done")
+	}()
+
+	return c
+}
+
+// Heplers
+type fakeServer struct {
+	r proto.Reader
+	w proto.Writer
+	io.Closer
+}
+
+type conn struct {
+	*io.PipeReader
+	*io.PipeWriter
+}
+
+func (c *conn) Close() error {
+	c.PipeReader.Close()
+	c.PipeWriter.Close()
+	return nil
+}
+
+func newPair(t *testing.T) (*routeros.Client, *fakeServer) {
+	ar, aw := io.Pipe()
+	br, bw := io.Pipe()
+
+	c, err := routeros.NewClient(&conn{ar, bw})
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	s := &fakeServer{
+		proto.NewReader(br),
+		proto.NewWriter(aw),
+		&conn{br, aw},
+	}
+
+	return c, s
+}
+
+func (f *fakeServer) readSentence(t *testing.T, want string) {
+	sen, err := f.r.ReadSentence()
+	if err != nil {
+		t.Fatal(err)
+	}
+	if sen.String() != want {
+		t.Fatalf("Sentence (%s); want (%s)", sen.String(), want)
+	}
+	t.Logf("< %s\n", sen)
+}
+
+func (f *fakeServer) writeSentence(t *testing.T, sentence ...string) {
+	t.Logf("> %#q\n", sentence)
+	f.w.BeginSentence()
+	for _, word := range sentence {
+		f.w.WriteWord(word)
+	}
+	err := f.w.EndSentence()
+	if err != nil {
+		t.Fatal(err)
+	}
+}
diff --git a/config/config_test.go b/config/config_test.go
index 7317566..75b82f3 100644
--- a/config/config_test.go
+++ b/config/config_test.go
@@ -31,6 +31,7 @@ func TestShouldParse(t *testing.T) {
 	assertFeature("Ipsec", c.Features.Ipsec, t)
 	assertFeature("Lte", c.Features.Lte, t)
 	assertFeature("Netwatch", c.Features.Netwatch, t)
+	assertFeature("Cloud", c.Features.Cloud, t)
 }
 
 func loadTestFile(t *testing.T) []byte {