Skip to content
This repository has been archived by the owner on Jul 25, 2023. It is now read-only.

Commit

Permalink
Fix naming of metrics to remove service from name as the app name wil…
Browse files Browse the repository at this point in the history
…l be included with the metric
  • Loading branch information
lshep311 committed Mar 14, 2019
1 parent 124adc8 commit d02c4ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func NewMiddleware(name string, buckets ...float64) func(next http.Handler) http
var m Middleware
m.reqs = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: name + "_requests_total",
Name: "http_requests_total",
Help: "How many HTTP requests processed, partitioned by status code, method and HTTP path.",
ConstLabels: prometheus.Labels{"service": name},
},
Expand All @@ -37,7 +37,7 @@ func NewMiddleware(name string, buckets ...float64) func(next http.Handler) http
buckets = dflBuckets
}
m.latency = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Name: name + "_duration_milliseconds",
Name: "http_request_duration_milliseconds",
Help: "How long it took to process the request, partitioned by status code, method and HTTP path.",
ConstLabels: prometheus.Labels{"service": name},
Buckets: buckets,
Expand Down

0 comments on commit d02c4ba

Please sign in to comment.