plugin/metrics: Add a metric to monitor which plugin(s) is(are) enabled (#2700)

* Add a GaugeVec for enabled plugins monitoring.

Signed-off-by: Jiacheng Xu <xjcmaxwellcjx@gmail.com>

* Add server label and zone label for enable_plugin matric.

* Add a test for PluginEnabled metric

* Add description for enabledPlugin metric.

* Change the description for the enabledPlugin metric.

* Reset the enabledPlugin metric when restart the server.

* Add the bug session for enabledPlugin metric.

* Remove the resolveTCPAddr
This commit is contained in:
Jiacheng Xu
2019-03-23 10:43:15 +01:00
committed by Miek Gieben
parent a3dd8cdf8d
commit 0e137b23f1
5 changed files with 63 additions and 0 deletions

View File

@@ -65,6 +65,12 @@ var (
Name: "panic_count_total",
Help: "A metrics that counts the number of panics.",
})
PluginEnabled = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: plugin.Namespace,
Name: "plugin_enabled",
Help: "A metric that indicates whether a plugin is enabled on per server and zone basis.",
}, []string{"server", "zone", "name"})
)
const (