Skip to content

Commit

Permalink
Rename Prom Handler to MetricsHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
Frostman committed Jun 21, 2018
1 parent 0b88067 commit 4695d29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ type prometheusHandler struct {
responseSize *prometheus.HistogramVec
}

// NewPrometheusHandler returns middleware that collects HTTP req/resp specific metrics
func NewPrometheusHandler(serviceName string, handler http.Handler) http.Handler {
// NewMetricsHandler returns middleware that collects HTTP req/resp specific metrics
func NewMetricsHandler(serviceName string, handler http.Handler) http.Handler {
requests := prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "http_requests_total",
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (server *Server) startHTTPServer() {

// todo write to logrus
handler = handlers.CombinedLoggingHandler(os.Stdout, handler) // todo(slukjanov): make it at least somehow configurable - for example, select file to write to with rotation
handler = middleware.NewPrometheusHandler(serviceName, handler)
handler = middleware.NewMetricsHandler(serviceName, handler)
handler = middleware.NewPanicHandler(handler)
// todo(slukjanov): add configurable handlers.ProxyHeaders to f behind the nginx or any other proxy
// todo(slukjanov): add compression handler and compress by default in client
Expand Down

0 comments on commit 4695d29

Please sign in to comment.