mirror of https://github.com/tikv/client-go.git
Upgrade prometheus client to v1.x (#31)
Replace push.AddFromGatherer with push.New Signed-off-by: lucklove <gnu.crazier@gmail.com>
This commit is contained in:
parent
72c56e71aa
commit
d9c03d0f44
|
|
@ -41,12 +41,7 @@ func PushMetrics(ctx context.Context, addr string, interval time.Duration, job,
|
|||
case <-ticker.C:
|
||||
}
|
||||
|
||||
err := push.AddFromGatherer(
|
||||
job,
|
||||
map[string]string{"instance": instance},
|
||||
addr,
|
||||
prometheus.DefaultGatherer,
|
||||
)
|
||||
err := push.New(addr, job).Grouping("instance", instance).Gatherer(prometheus.DefaultGatherer).Push()
|
||||
if err != nil {
|
||||
log.Errorf("cannot push metrics to prometheus pushgateway: %v", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue