diff --git a/internal/api/router.go b/internal/api/router.go index 936d6ab0b..1c70c6bc5 100644 --- a/internal/api/router.go +++ b/internal/api/router.go @@ -28,9 +28,9 @@ func prommetricsGin() gin.HandlerFunc { //prommetrics.HttpCall(path, c.Request.Method, c.Writer.Status(), time.Since(start)) if c.Request.Method == http.MethodPost { if resp := apiresp.GetGinApiResponse(c); resp == nil { - prommetrics.APICall(path, -1, "NO_GIN_RESPONSE_FOUND") + prommetrics.APICall(path, -1) } else { - prommetrics.APICall(path, resp.ErrCode, resp.ErrMsg) + prommetrics.APICall(path, resp.ErrCode) } } } diff --git a/pkg/common/prommetrics/api.go b/pkg/common/prommetrics/api.go index aa5e0a60e..15f8a3e31 100644 --- a/pkg/common/prommetrics/api.go +++ b/pkg/common/prommetrics/api.go @@ -17,7 +17,7 @@ var ( Name: "api_count", Help: "Total number of API calls", }, - []string{"path", "code", "type"}, + []string{"path", "code"}, ) httpCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ @@ -33,8 +33,8 @@ func init() { apiRegistry.MustRegister(apiCounter, httpCounter) } -func APICall(path string, apiCode int, apiType string) { - apiCounter.With(prometheus.Labels{"path": path, "code": strconv.Itoa(apiCode), "type": apiType}).Inc() +func APICall(path string, apiCode int) { + apiCounter.With(prometheus.Labels{"path": path, "code": strconv.Itoa(apiCode)}).Inc() } //func HttpCall(path string, method string, status int, duration time.Duration) {