mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
tech(metrics): move all request counters into one middleware
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/grafana/grafana/pkg/metrics"
|
||||
"github.com/grafana/grafana/pkg/middleware"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"gopkg.in/macaron.v1"
|
||||
@@ -88,10 +87,8 @@ func ApiError(status int, message string, err error) *NormalResponse {
|
||||
|
||||
switch status {
|
||||
case 404:
|
||||
metrics.M_Api_Status_404.Inc(1)
|
||||
data["message"] = "Not Found"
|
||||
case 500:
|
||||
metrics.M_Api_Status_500.Inc(1)
|
||||
data["message"] = "Internal Server Error"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user