From ddf0bfa01f19e8bdf273f8b39e3a369534456074 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 9 Mar 2019 00:24:35 +0300 Subject: [PATCH] put metrics in own namespace Signed-off-by: Vasiliy Tolstov --- prometheus.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/prometheus.go b/prometheus.go index c9f391c..9414582 100644 --- a/prometheus.go +++ b/prometheus.go @@ -35,24 +35,27 @@ func NewHandlerWrapper(opts ...server.Option) server.HandlerWrapper { opsCounter := prometheus.NewCounterVec( prometheus.CounterOpts{ - Name: fmt.Sprintf("%s_request_total", defaultMetricPrefix), - Help: "How many go-micro requests processed, partitioned by method and status", + Namespace: "micro", + Name: "request_total", + Help: "How many go-micro requests processed, partitioned by method and status", }, []string{"method", "status"}, ) timeCounterSummary := prometheus.NewSummaryVec( prometheus.SummaryOpts{ - Name: fmt.Sprintf("%s_upstream_latency_microseconds", defaultMetricPrefix), - Help: "Service backend method request latencies in microseconds", + Namespace: "micro", + Name: "upstream_latency_microseconds", + Help: "Service backend method request latencies in microseconds", }, []string{"method"}, ) timeCounterHistogram := prometheus.NewHistogramVec( prometheus.HistogramOpts{ - Name: fmt.Sprintf("%s_request_duration_seconds", defaultMetricPrefix), - Help: "Service method request time in seconds", + Namespace: "micro", + Name: "request_duration_seconds", + Help: "Service method request time in seconds", }, []string{"method"}, )