summaryrefslogtreecommitdiff
path: root/plugins/metrics
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/metrics')
-rw-r--r--plugins/metrics/tests/metrics_test.go1
-rw-r--r--plugins/metrics/tests/plugin1.go9
2 files changed, 9 insertions, 1 deletions
diff --git a/plugins/metrics/tests/metrics_test.go b/plugins/metrics/tests/metrics_test.go
index d3043fbb..ed5d085a 100644
--- a/plugins/metrics/tests/metrics_test.go
+++ b/plugins/metrics/tests/metrics_test.go
@@ -157,6 +157,7 @@ func TestMetricsGaugeCollector(t *testing.T) {
out, err := get("http://localhost:2112/metrics")
assert.NoError(t, err)
assert.Contains(t, out, "my_gauge 100")
+ assert.Contains(t, out, "my_gauge2 100")
out, err = get("http://localhost:2112/metrics")
assert.NoError(t, err)
diff --git a/plugins/metrics/tests/plugin1.go b/plugins/metrics/tests/plugin1.go
index fb2a2235..b48c415d 100644
--- a/plugins/metrics/tests/plugin1.go
+++ b/plugins/metrics/tests/plugin1.go
@@ -35,5 +35,12 @@ func (p1 *Plugin1) MetricsCollector() []prometheus.Collector {
})
collector.Set(100)
- return []prometheus.Collector{collector}
+
+ collector2 := prometheus.NewGauge(prometheus.GaugeOpts{
+ Name: "my_gauge2",
+ Help: "My gauge2 value",
+ })
+
+ collector2.Set(100)
+ return []prometheus.Collector{collector, collector2}
}