Commit df33cbc8 by Donn Pebe

Fix wrong metrics counter

parent a38a06a0
...@@ -87,10 +87,10 @@ func ApiError(status int, message string, err error) *NormalResponse { ...@@ -87,10 +87,10 @@ func ApiError(status int, message string, err error) *NormalResponse {
switch status { switch status {
case 404: case 404:
metrics.M_Api_Status_404.Inc(1)
resp["message"] = "Not Found" resp["message"] = "Not Found"
metrics.M_Api_Status_500.Inc(1)
case 500: case 500:
metrics.M_Api_Status_404.Inc(1) metrics.M_Api_Status_500.Inc(1)
resp["message"] = "Internal Server Error" resp["message"] = "Internal Server Error"
} }
......
...@@ -197,10 +197,10 @@ func (ctx *Context) JsonApiErr(status int, message string, err error) { ...@@ -197,10 +197,10 @@ func (ctx *Context) JsonApiErr(status int, message string, err error) {
switch status { switch status {
case 404: case 404:
metrics.M_Api_Status_404.Inc(1)
resp["message"] = "Not Found" resp["message"] = "Not Found"
metrics.M_Api_Status_500.Inc(1)
case 500: case 500:
metrics.M_Api_Status_404.Inc(1) metrics.M_Api_Status_500.Inc(1)
resp["message"] = "Internal Server Error" resp["message"] = "Internal Server Error"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment