diff --git a/clientlibrary/service/lib.go b/clientlibrary/service/lib.go index 69296ae78..1ac6ca108 100644 --- a/clientlibrary/service/lib.go +++ b/clientlibrary/service/lib.go @@ -6,12 +6,13 @@ import ( _ "net/http/pprof" "os" + "github.com/gogo/protobuf/proto" + "github.com/anytypeio/go-anytype-middleware/core" "github.com/anytypeio/go-anytype-middleware/core/event" + "github.com/anytypeio/go-anytype-middleware/metrics" "github.com/anytypeio/go-anytype-middleware/pb" - "github.com/anytypeio/go-anytype-middleware/pkg/lib/logging" - "github.com/gogo/protobuf/proto" ) var log = logging.Logger("anytype-mw") @@ -21,6 +22,7 @@ var mw = core.New() func init() { fmt.Printf("mw jsaddon: %s\n", core.GetVersionDescription()) registerClientCommandsHandler(mw) + metrics.SharedClient.InitWithKey(metrics.DefaultAmplitudeKey) if debug, ok := os.LookupEnv("ANYPROF"); ok && debug != "" { go func() { http.ListenAndServe(debug, nil) diff --git a/cmd/grpcserver/grpc.go b/cmd/grpcserver/grpc.go index 4240c588f..cc1a1e9a9 100644 --- a/cmd/grpcserver/grpc.go +++ b/cmd/grpcserver/grpc.go @@ -73,8 +73,7 @@ func main() { http.ListenAndServe(debug, nil) }() } - - metrics.SharedClient.InitWithKey("406eb9bda5a4f8b94d1ca05936acab59") + metrics.SharedClient.InitWithKey(metrics.DefaultAmplitudeKey) var stopChan = make(chan os.Signal, 2) signal.Notify(stopChan, os.Interrupt, syscall.SIGTERM, syscall.SIGINT) diff --git a/metrics/metrics.go b/metrics/metrics.go index c2b722714..f53cac8f9 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -13,6 +13,7 @@ import ( ) var log = logging.Logger("anytype-logger") +const DefaultAmplitudeKey = "406eb9bda5a4f8b94d1ca05936acab59" type threadsMetrics struct { client Client