simplify metrics settings

This commit is contained in:
Chris Lu
2019-06-23 15:29:49 -07:00
parent 6f8b335007
commit d5560f2705
7 changed files with 252 additions and 134 deletions

View File

@@ -107,6 +107,10 @@ func init() {
func LoopPushingMetric(name, instance string, gatherer *prometheus.Registry, fnGetMetricsDest func() (addr string, intervalSeconds int)) {
if fnGetMetricsDest == nil {
return
}
addr, intervalSeconds := fnGetMetricsDest()
pusher := push.New(addr, name).Gatherer(gatherer).Grouping("instance", instance)
currentAddr := addr