This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//step1:初始一个counter, with help string | |
pushCounter = prometheus.NewCounter(prometheus.CounterOpts{ | |
Name: "repository_pushes", | |
Help: "Number of pushes to external repository.", | |
}) | |
//setp2: 注册容器 | |
err = prometheus.Register(pushCounter) | |
if err != nil { | |
fmt.Println("Push counter couldn't be registered AGAIN, no counting will happen:", err) |
OlderNewer