From 4157662f1a0f52c64a14a9bb1eb47d45af2e0a83 Mon Sep 17 00:00:00 2001 From: Tsovak Date: Fri, 31 Jul 2020 15:06:38 +0300 Subject: [PATCH] NOISSUE: add profiler --- cmd/api/main.go | 6 ++++++ cmd/block-explorer/main.go | 6 ++++++ go.mod | 1 + 3 files changed, 13 insertions(+) diff --git a/cmd/api/main.go b/cmd/api/main.go index 0775854e..431fed6b 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -14,6 +14,7 @@ import ( "github.com/insolar/spec-insolar-block-explorer-api/v1/server" "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" + "github.com/stackimpact/stackimpact-go" "github.com/insolar/block-explorer/api" "github.com/insolar/block-explorer/configuration" @@ -37,6 +38,11 @@ func main() { ctx, logger := belogger.InitLogger(ctx, cfg.Log, "block_explorer_api") logger.Info("Config and logger were initialized") + _ = stackimpact.Start(stackimpact.Options{ + AgentKey: "5256279e53f4aa857af6ee782a4c53e72034b0da", + AppName: "api", + }) + router := api.NewRouter() err := router.Start(ctx) if err != nil { diff --git a/cmd/block-explorer/main.go b/cmd/block-explorer/main.go index b17b6b99..6387f8d4 100644 --- a/cmd/block-explorer/main.go +++ b/cmd/block-explorer/main.go @@ -23,6 +23,7 @@ import ( "github.com/insolar/insconfig" "github.com/insolar/insolar/ledger/heavy/exporter" "github.com/pkg/errors" + "github.com/stackimpact/stackimpact-go" "github.com/insolar/block-explorer/etl/dbconn" "github.com/insolar/block-explorer/etl/storage" @@ -49,6 +50,11 @@ func main() { ctx, logger := belogger.InitLogger(context.Background(), cfg.Log, "block_explorer") logger.Info("Config and logger were initialized") + _ = stackimpact.Start(stackimpact.Options{ + AgentKey: "5256279e53f4aa857af6ee782a4c53e72034b0da", + AppName: "gbe", + }) + router := api.NewRouter() _ = router.Start(ctx) defer func() { diff --git a/go.mod b/go.mod index b669d0c1..72858eb3 100644 --- a/go.mod +++ b/go.mod @@ -29,6 +29,7 @@ require ( github.com/rs/zerolog v1.15.0 github.com/skudasov/loadgen v0.0.22 github.com/spf13/cast v1.3.1 // indirect + github.com/stackimpact/stackimpact-go v2.3.10+incompatible // indirect github.com/stretchr/testify v1.5.1 github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8 // indirect github.com/urfave/cli/v2 v2.2.0 // indirect