frostfs-s3-gw/cmd/gate/app-metrics.go

16 lines
281 B
Go
Raw Normal View History

2020-07-06 09:18:16 +00:00
package main
import (
"github.com/gorilla/mux"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/spf13/viper"
)
func attachMetrics(v *viper.Viper, r *mux.Router) {
2020-07-07 11:25:13 +00:00
if !v.GetBool(cfgEnableMetrics) {
2020-07-06 09:18:16 +00:00
return
}
r.Handle("/metrics", promhttp.Handler())
}