diff --git a/src/server/router/router.go b/src/server/router/router.go index 221e7cad..4e33fdc5 100644 --- a/src/server/router/router.go +++ b/src/server/router/router.go @@ -16,8 +16,11 @@ import ( "github.com/didi/nightingale/v5/src/server/naming" promstat "github.com/didi/nightingale/v5/src/server/stat" + jsoniter "github.com/json-iterator/go" ) +var json = jsoniter.ConfigCompatibleWithStandardLibrary + func New(version string, reloadFunc func()) *gin.Engine { gin.SetMode(config.C.RunMode) diff --git a/src/server/router/router_datadog.go b/src/server/router/router_datadog.go index ceb8cc82..06338065 100644 --- a/src/server/router/router_datadog.go +++ b/src/server/router/router_datadog.go @@ -3,7 +3,6 @@ package router import ( "compress/gzip" "compress/zlib" - "encoding/json" "fmt" "io/ioutil" "net/http" diff --git a/src/server/router/router_openfalcon.go b/src/server/router/router_openfalcon.go index c8943955..250b34c5 100644 --- a/src/server/router/router_openfalcon.go +++ b/src/server/router/router_openfalcon.go @@ -2,7 +2,6 @@ package router import ( "compress/gzip" - "encoding/json" "fmt" "io/ioutil" "strconv" @@ -140,6 +139,7 @@ func (m *FalconMetric) ToProm() (*prompb.TimeSeries, string, error) { } func falconPush(c *gin.Context) { + var bs []byte var err error var r *gzip.Reader diff --git a/src/server/router/router_opentsdb.go b/src/server/router/router_opentsdb.go index c7b167a3..9c34002c 100644 --- a/src/server/router/router_opentsdb.go +++ b/src/server/router/router_opentsdb.go @@ -2,7 +2,6 @@ package router import ( "compress/gzip" - "encoding/json" "fmt" "io/ioutil" "strconv"