From be5040e7a8f4635bc89bcccf1373cc9b0026d671 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Tue, 14 Feb 2017 22:56:12 +0100 Subject: [PATCH] prometheus: Remove mgmt_process_start_time_seconds metric That metric is useless as by default the prometheus golang client provides the `process_start_time_seconds` metric. This reverts commit 25e2af7c89a7b91ffc21e29271ebf4970d59811c. --- docs/prometheus.md | 1 - prometheus/prometheus.go | 13 +------------ test/shell/prometheus-1.sh | 3 --- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/docs/prometheus.md b/docs/prometheus.md index df888da6..d1a83419 100644 --- a/docs/prometheus.md +++ b/docs/prometheus.md @@ -52,7 +52,6 @@ Here is a list of the metrics we provide: - `mgmt_checkapply_total`: The number of CheckApply's that mgmt has run - `mgmt_failures_total`: The number of resources that have failed - `mgmt_failures_current`: The number of resources that have failed -- `mgmt_process_start_time_seconds`: Start time of the process since unix epoch in seconds For each metric, you will get some extra labels: diff --git a/prometheus/prometheus.go b/prometheus/prometheus.go index bf99d3ed..c2edb412 100644 --- a/prometheus/prometheus.go +++ b/prometheus/prometheus.go @@ -36,8 +36,7 @@ const DefaultPrometheusListen = "127.0.0.1:9233" type Prometheus struct { Listen string // the listen specification for the net/http server - checkApplyTotal *prometheus.CounterVec // total of CheckApplies that have been triggered - processStartTimeSeconds prometheus.Gauge // process start time in seconds since unix epoch + checkApplyTotal *prometheus.CounterVec // total of CheckApplies that have been triggered } @@ -60,16 +59,6 @@ func (obj *Prometheus) Init() error { ) prometheus.MustRegister(obj.checkApplyTotal) - obj.processStartTimeSeconds = prometheus.NewGauge( - prometheus.GaugeOpts{ - Name: "mgmt_process_start_time_seconds", - Help: "Start time of the process since unix epoch in seconds.", - }, - ) - prometheus.MustRegister(obj.processStartTimeSeconds) - // directly set the processStartTimeSeconds - obj.processStartTimeSeconds.SetToCurrentTime() - return nil } diff --git a/test/shell/prometheus-1.sh b/test/shell/prometheus-1.sh index f6811592..5421a679 100755 --- a/test/shell/prometheus-1.sh +++ b/test/shell/prometheus-1.sh @@ -11,9 +11,6 @@ curl 127.0.0.1:9233/metrics | grep "^etcd_server_has_leader 1" # Check that go metrics are loaded curl 127.0.0.1:9233/metrics | grep "^go_goroutines [0-9]\+" -# Check mgmt_process_start_time_seconds -curl 127.0.0.1:9233/metrics | grep "^mgmt_process_start_time_seconds [0-9]\+" - killall -SIGINT mgmt # send ^C to exit mgmt wait $pid # get exit status exit $?