|
|
@ -17,7 +17,7 @@ var (
|
|
|
|
Name: "api_count",
|
|
|
|
Name: "api_count",
|
|
|
|
Help: "Total number of API calls",
|
|
|
|
Help: "Total number of API calls",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
[]string{"path", "code", "type"},
|
|
|
|
[]string{"path", "code"},
|
|
|
|
)
|
|
|
|
)
|
|
|
|
httpCounter = prometheus.NewCounterVec(
|
|
|
|
httpCounter = prometheus.NewCounterVec(
|
|
|
|
prometheus.CounterOpts{
|
|
|
|
prometheus.CounterOpts{
|
|
|
@ -33,8 +33,8 @@ func init() {
|
|
|
|
apiRegistry.MustRegister(apiCounter, httpCounter)
|
|
|
|
apiRegistry.MustRegister(apiCounter, httpCounter)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func APICall(path string, apiCode int, apiType string) {
|
|
|
|
func APICall(path string, apiCode int) {
|
|
|
|
apiCounter.With(prometheus.Labels{"path": path, "code": strconv.Itoa(apiCode), "type": apiType}).Inc()
|
|
|
|
apiCounter.With(prometheus.Labels{"path": path, "code": strconv.Itoa(apiCode)}).Inc()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//func HttpCall(path string, method string, status int, duration time.Duration) {
|
|
|
|
//func HttpCall(path string, method string, status int, duration time.Duration) {
|
|
|
|