put metrics in own namespace

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2019-03-09 00:24:35 +03:00
parent d927ad4673
commit ddf0bfa01f

View File

@ -35,24 +35,27 @@ func NewHandlerWrapper(opts ...server.Option) server.HandlerWrapper {
opsCounter := prometheus.NewCounterVec( opsCounter := prometheus.NewCounterVec(
prometheus.CounterOpts{ prometheus.CounterOpts{
Name: fmt.Sprintf("%s_request_total", defaultMetricPrefix), Namespace: "micro",
Help: "How many go-micro requests processed, partitioned by method and status", Name: "request_total",
Help: "How many go-micro requests processed, partitioned by method and status",
}, },
[]string{"method", "status"}, []string{"method", "status"},
) )
timeCounterSummary := prometheus.NewSummaryVec( timeCounterSummary := prometheus.NewSummaryVec(
prometheus.SummaryOpts{ prometheus.SummaryOpts{
Name: fmt.Sprintf("%s_upstream_latency_microseconds", defaultMetricPrefix), Namespace: "micro",
Help: "Service backend method request latencies in microseconds", Name: "upstream_latency_microseconds",
Help: "Service backend method request latencies in microseconds",
}, },
[]string{"method"}, []string{"method"},
) )
timeCounterHistogram := prometheus.NewHistogramVec( timeCounterHistogram := prometheus.NewHistogramVec(
prometheus.HistogramOpts{ prometheus.HistogramOpts{
Name: fmt.Sprintf("%s_request_duration_seconds", defaultMetricPrefix), Namespace: "micro",
Help: "Service method request time in seconds", Name: "request_duration_seconds",
Help: "Service method request time in seconds",
}, },
[]string{"method"}, []string{"method"},
) )