Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
refactor: remove segment reporting infrastructure (#18455)
Danny Xu347a3d4f11d9
diff --git a/backend/api/v1/auth_service.go b/backend/api/v1/auth_service.goindex b299c71a83..501b7f31bf 100644--- a/backend/api/v1/auth_service.go+++ b/backend/api/v1/auth_service.go@@ -27,13 +27,10 @@ import (storepb "github.com/bytebase/bytebase/backend/generated-go/store"v1pb "github.com/bytebase/bytebase/backend/generated-go/v1""github.com/bytebase/bytebase/backend/generated-go/v1/v1connect"- metricapi "github.com/bytebase/bytebase/backend/metric""github.com/bytebase/bytebase/backend/plugin/idp/ldap""github.com/bytebase/bytebase/backend/plugin/idp/oauth2""github.com/bytebase/bytebase/backend/plugin/idp/oidc""github.com/bytebase/bytebase/backend/plugin/idp/wif"- "github.com/bytebase/bytebase/backend/plugin/metric"- "github.com/bytebase/bytebase/backend/runner/metricreport""github.com/bytebase/bytebase/backend/store")@@ -71,19 +68,17 @@ type AuthService struct {store *store.Storesecret stringlicenseService *enterprise.LicenseService- metricReporter *metricreport.Reporterprofile *config.ProfilestateCfg *state.StateiamManager *iam.Manager}// NewAuthService creates a new AuthService.-func NewAuthService(store *store.Store, secret string, licenseService *enterprise.LicenseService, metricReporter *metricreport.Reporter, profile *config.Profile, stateCfg *state.State, iamManager *iam.Manager) *AuthService {+func NewAuthService(store *store.Store, secret string, licenseService *enterprise.LicenseService, profile *config.Profile, stateCfg *state.State, iamManager *iam.Manager) *AuthService {return &AuthService{store: store,secret: secret,licenseService: licenseService,- metricReporter: metricReporter,profile: profile,stateCfg: stateCfg,iamManager: iamManager,@@ -228,14 +223,6 @@ func (s *AuthService) Login(ctx context.Context, req *connect.Request[v1pb.Loginresponse.User = convertToUser(ctx, loginUser)- s.metricReporter.Report(ctx, &metric.Metric{- Name: metricapi.PrincipalLoginMetricName,- Value: 1,- Labels: map[string]any{- "email": loginUser.Email,- },- })-return resp, nil}diff --git a/backend/api/v1/debug_interceptor.go b/backend/api/v1/debug_interceptor.godeleted file mode 100644index 6714e30dd4..0000000000--- a/backend/api/v1/debug_interceptor.go+++ /dev/null@@ -1,96 +0,0 @@-package v1--import (- "context"- "fmt"- "log/slog"- "time"-- "connectrpc.com/connect"-- "github.com/pkg/errors"-- "github.com/bytebase/bytebase/backend/common"- "github.com/bytebase/bytebase/backend/common/log"- "github.com/bytebase/bytebase/backend/metric"- metricplugin "github.com/bytebase/bytebase/backend/plugin/metric"- "github.com/bytebase/bytebase/backend/runner/metricreport"-)--// DebugInterceptor is the v1 debug interceptor for gRPC server.-type DebugInterceptor struct {- metricReporter *metricreport.Reporter-}--// NewDebugInterceptor returns a new v1 API debug interceptor.-func NewDebugInterceptor(metricReporter *metricreport.Reporter) *DebugInterceptor {- return &DebugInterceptor{- metricReporter: metricReporter,- }-}--func (in *DebugInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {- return func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {- startTime := time.Now()- resp, err := next(ctx, req)- in.debugInterceptorDo(ctx, req.Spec().Procedure, err, startTime)-- // Truncate error message to 10240 characters.- if connectErr := (&connect.Error{}); errors.As(err, &connectErr) {- if msg, truncated := common.TruncateString(connectErr.Message(), 10240); truncated {- slog.Info("Truncated error message", slog.String("fullMethod", req.Spec().Procedure), slog.String("original error message", connectErr.Message()))- err = connect.NewError(connectErr.Code(), errors.New("[TRUNCATED] "+msg))- }- }-- return resp, err- }-}--func (*DebugInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {- return func(ctx context.Context, spec connect.Spec) connect.StreamingClientConn {- return next(ctx, spec)- }-}-func (in *DebugInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {- return func(ctx context.Context, conn connect.StreamingHandlerConn) error {- startTime := time.Now()- err := next(ctx, conn)- in.debugInterceptorDo(ctx, conn.Spec().Procedure, err, startTime)-- return err- }-}--func (in *DebugInterceptor) debugInterceptorDo(ctx context.Context, fullMethod string, err error, startTime time.Time) {- var logLevel slog.Level- var logMsg string- if common.IsNil(err) {- logLevel = slog.LevelDebug- logMsg = "ok"- } else {- connectErr := (&connect.Error{})- if !errors.As(err, &connectErr) {- connectErr = connect.NewError(connect.CodeUnknown, err)- }- switch connectErr.Code() {- case connect.CodeUnauthenticated, connect.CodeOutOfRange, connect.CodePermissionDenied, connect.CodeNotFound, connect.CodeInvalidArgument:- logLevel = slog.LevelDebug- logMsg = "client error"- case connect.CodeInternal, connect.CodeUnknown, connect.CodeDataLoss, connect.CodeUnavailable, connect.CodeDeadlineExceeded:- logLevel = slog.LevelError- logMsg = "server error"- default:- logLevel = slog.LevelError- logMsg = "unknown error"- }- }- slog.Log(ctx, logLevel, logMsg, "method", fullMethod, log.BBError(err), "latency", fmt.Sprintf("%vms", time.Since(startTime).Milliseconds()))- in.metricReporter.Report(ctx, &metricplugin.Metric{- Name: metric.APIRequestMetricName,- Value: 1,- Labels: map[string]any{- "method": fullMethod,- },- })-}diff --git a/backend/api/v1/instance_service.go b/backend/api/v1/instance_service.goindex 50f3d14038..36bba63bec 100644--- a/backend/api/v1/instance_service.go+++ b/backend/api/v1/instance_service.go@@ -21,10 +21,7 @@ import (storepb "github.com/bytebase/bytebase/backend/generated-go/store"v1pb "github.com/bytebase/bytebase/backend/generated-go/v1""github.com/bytebase/bytebase/backend/generated-go/v1/v1connect"- metricapi "github.com/bytebase/bytebase/backend/metric""github.com/bytebase/bytebase/backend/plugin/db"- "github.com/bytebase/bytebase/backend/plugin/metric"- "github.com/bytebase/bytebase/backend/runner/metricreport""github.com/bytebase/bytebase/backend/runner/schemasync""github.com/bytebase/bytebase/backend/store")@@ -35,7 +32,6 @@ type InstanceService struct {store *store.Storeprofile *config.ProfilelicenseService *enterprise.LicenseService- metricReporter *metricreport.ReporterstateCfg *state.StatedbFactory *dbfactory.DBFactoryschemaSyncer *schemasync.Syncer@@ -44,12 +40,11 @@ type InstanceService struct {}// NewInstanceService creates a new InstanceService.-func NewInstanceService(store *store.Store, profile *config.Profile, licenseService *enterprise.LicenseService, metricReporter *metricreport.Reporter, stateCfg *state.State, dbFactory *dbfactory.DBFactory, schemaSyncer *schemasync.Syncer, iamManager *iam.Manager, sampleInstanceManager *sampleinstance.Manager) *InstanceService {+func NewInstanceService(store *store.Store, profile *config.Profile, licenseService *enterprise.LicenseService, stateCfg *state.State, dbFactory *dbfactory.DBFactory, schemaSyncer *schemasync.Syncer, iamManager *iam.Manager, sampleInstanceManager *sampleinstance.Manager) *InstanceService {return &InstanceService{store: store,profile: profile,licenseService: licenseService,- metricReporter: metricReporter,stateCfg: stateCfg,dbFactory: dbFactory,schemaSyncer: schemaSyncer,@@ -231,14 +226,6 @@ func (s *InstanceService) CreateInstance(ctx context.Context, req *connect.Reques.schemaSyncer.SyncAllDatabases(ctx, instance)}- s.metricReporter.Report(ctx, &metric.Metric{- Name: metricapi.InstanceCreateMetricName,- Value: 1,- Labels: map[string]any{- "engine": instance.Metadata.GetEngine(),- },- })-result := convertInstanceMessage(instance)return connect.NewResponse(result), nil}diff --git a/backend/api/v1/issue_service.go b/backend/api/v1/issue_service.goindex a8007987f5..13784ea319 100644--- a/backend/api/v1/issue_service.go+++ b/backend/api/v1/issue_service.go@@ -24,9 +24,6 @@ import (storepb "github.com/bytebase/bytebase/backend/generated-go/store"v1pb "github.com/bytebase/bytebase/backend/generated-go/v1""github.com/bytebase/bytebase/backend/generated-go/v1/v1connect"- metricapi "github.com/bytebase/bytebase/backend/metric"- "github.com/bytebase/bytebase/backend/plugin/metric"- "github.com/bytebase/bytebase/backend/runner/metricreport""github.com/bytebase/bytebase/backend/store""github.com/bytebase/bytebase/backend/utils")@@ -40,7 +37,6 @@ type IssueService struct {licenseService *enterprise.LicenseServiceprofile *config.ProfileiamManager *iam.Manager- metricReporter *metricreport.Reporter}type filterIssueMessage struct {@@ -57,7 +53,6 @@ func NewIssueService(licenseService *enterprise.LicenseService,profile *config.Profile,iamManager *iam.Manager,- metricReporter *metricreport.Reporter,) *IssueService {return &IssueService{store: store,@@ -66,7 +61,6 @@ func NewIssueService(licenseService: licenseService,profile: profile,iamManager: iamManager,- metricReporter: metricReporter,}}@@ -598,14 +592,6 @@ func (s *IssueService) createIssueGrantRequest(ctx context.Context, request *v1preturn nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to convert to issue, error: %v", err))}- s.metricReporter.Report(ctx, &metric.Metric{- Name: metricapi.IssueCreateMetricName,- Value: 1,- Labels: map[string]any{- "type": issue.Type,- },- })-return connect.NewResponse(converted), nil}diff --git a/backend/api/v1/subscription_service.go b/backend/api/v1/subscription_service.goindex ee0171650d..a3726ff597 100644--- a/backend/api/v1/subscription_service.go+++ b/backend/api/v1/subscription_service.go@@ -11,7 +11,6 @@ import ("github.com/bytebase/bytebase/backend/enterprise"v1pb "github.com/bytebase/bytebase/backend/generated-go/v1""github.com/bytebase/bytebase/backend/generated-go/v1/v1connect"- "github.com/bytebase/bytebase/backend/runner/metricreport""github.com/bytebase/bytebase/backend/store")@@ -20,7 +19,6 @@ type SubscriptionService struct {v1connect.UnimplementedSubscriptionServiceHandlerstore *store.Storeprofile *config.Profile- metricReporter *metricreport.ReporterlicenseService *enterprise.LicenseService}@@ -28,12 +26,10 @@ type SubscriptionService struct {func NewSubscriptionService(store *store.Store,profile *config.Profile,- metricReporter *metricreport.Reporter,licenseService *enterprise.LicenseService) *SubscriptionService {return &SubscriptionService{store: store,profile: profile,- metricReporter: metricReporter,licenseService: licenseService,}}diff --git a/backend/api/v1/user_service.go b/backend/api/v1/user_service.goindex 7cb01cdd8e..5b901a66e0 100644--- a/backend/api/v1/user_service.go+++ b/backend/api/v1/user_service.go@@ -24,9 +24,6 @@ import (storepb "github.com/bytebase/bytebase/backend/generated-go/store"v1pb "github.com/bytebase/bytebase/backend/generated-go/v1""github.com/bytebase/bytebase/backend/generated-go/v1/v1connect"- metricapi "github.com/bytebase/bytebase/backend/metric"- "github.com/bytebase/bytebase/backend/plugin/metric"- "github.com/bytebase/bytebase/backend/runner/metricreport""github.com/bytebase/bytebase/backend/store""github.com/bytebase/bytebase/backend/utils")@@ -37,19 +34,17 @@ type UserService struct {store *store.Storesecret stringlicenseService *enterprise.LicenseService- metricReporter *metricreport.Reporterprofile *config.ProfilestateCfg *state.StateiamManager *iam.Manager}// NewUserService creates a new UserService.-func NewUserService(store *store.Store, secret string, licenseService *enterprise.LicenseService, metricReporter *metricreport.Reporter, profile *config.Profile, stateCfg *state.State, iamManager *iam.Manager) *UserService {+func NewUserService(store *store.Store, secret string, licenseService *enterprise.LicenseService, profile *config.Profile, stateCfg *state.State, iamManager *iam.Manager) *UserService {return &UserService{store: store,secret: secret,licenseService: licenseService,- metricReporter: metricReporter,profile: profile,stateCfg: stateCfg,iamManager: iamManager,@@ -309,20 +304,6 @@ func (s *UserService) CreateUser(ctx context.Context, request *connect.Request[v}}- isFirstUser := user.ID == common.PrincipalIDForFirstUser- s.metricReporter.Report(ctx, &metric.Metric{- Name: metricapi.PrincipalRegistrationMetricName,- Value: 1,- Labels: map[string]any{- "email": user.Email,- "name": user.Name,- "phone": user.Phone,- // We only send lark notification for the first principal registration.- // false means do not notify upfront. Later the notification will be triggered by the scheduler.- "lark_notified": !isFirstUser,- },- })-userResponse := convertToUser(ctx, user)if request.Msg.User.UserType == v1pb.UserType_SERVICE_ACCOUNT {userResponse.ServiceKey = passworddiff --git a/backend/bin/server/cmd/profile_dev.go b/backend/bin/server/cmd/profile_dev.goindex d12b4bca05..cc3cd8cc61 100644--- a/backend/bin/server/cmd/profile_dev.go+++ b/backend/bin/server/cmd/profile_dev.go@@ -10,7 +10,5 @@ import (func activeProfile(dataDir string) *config.Profile {p := getBaseProfile(dataDir)p.Mode = common.ReleaseModeDev- // Metric collection is disabled in dev mode.- // p.MetricConnectionKey = "3zcZLeX3ahvlueEJqNyJysGfVAErsjjT"return p}diff --git a/backend/bin/server/cmd/profile_release.go b/backend/bin/server/cmd/profile_release.goindex 383a246fd7..d8b28d02df 100644--- a/backend/bin/server/cmd/profile_release.go+++ b/backend/bin/server/cmd/profile_release.go@@ -10,9 +10,5 @@ import (func activeProfile(dataDir string) *config.Profile {p := getBaseProfile(dataDir)p.Mode = common.ReleaseModeProd- // Set metric connection key. Actual collection is controlled by workspace setting.- if !p.Demo {- p.MetricConnectionKey = "so9lLwj5zLjH09sxNabsyVNYSsAHn68F"- }return p}diff --git a/backend/component/config/profile.go b/backend/component/config/profile.goindex 9fc4881e2a..2d1fe95cd0 100644--- a/backend/component/config/profile.go+++ b/backend/component/config/profile.go@@ -37,8 +37,6 @@ type Profile struct {GitCommit string// PgURL is the optional external PostgreSQL instance connection urlPgURL string- // MetricConnectionKey is the connection key for metric.- MetricConnectionKey string// LastActiveTS is the service last active timestamp, any API calls will refresh this value.LastActiveTS atomic.Int64diff --git a/backend/metric/collector/docs.go b/backend/metric/collector/docs.godeleted file mode 100644index f115b8298a..0000000000--- a/backend/metric/collector/docs.go+++ /dev/null@@ -1,2 +0,0 @@-// Package collector implements the collector for metrics reporting.-package collectordiff --git a/backend/metric/collector/instance_count.go b/backend/metric/collector/instance_count.godeleted file mode 100644index 11723cb91b..0000000000--- a/backend/metric/collector/instance_count.go+++ /dev/null@@ -1,46 +0,0 @@-package collector--import (- "context"-- metricapi "github.com/bytebase/bytebase/backend/metric"- "github.com/bytebase/bytebase/backend/plugin/metric"- "github.com/bytebase/bytebase/backend/store"-)--var _ metric.Collector = (*instanceCountCollector)(nil)--// instanceCountCollector is the metric data collector for instance.-type instanceCountCollector struct {- store *store.Store-}--// NewInstanceCountCollector creates a new instance of instanceCollector.-func NewInstanceCountCollector(store *store.Store) metric.Collector {- return &instanceCountCollector{- store: store,- }-}--// Collect will collect the metric for instance.-func (c *instanceCountCollector) Collect(ctx context.Context) ([]*metric.Metric, error) {- var res []*metric.Metric-- instanceCountMetricList, err := c.store.CountInstanceGroupByEngineAndEnvironmentID(ctx)- if err != nil {- return nil, err- }-- for _, instanceCountMetric := range instanceCountMetricList {- res = append(res, &metric.Metric{- Name: metricapi.InstanceCountMetricName,- Value: instanceCountMetric.Count,- Labels: map[string]any{- "engine": instanceCountMetric.Engine.String(),- "environment": instanceCountMetric.EnvironmentID,- },- })- }-- return res, nil-}diff --git a/backend/metric/collector/issue_count.go b/backend/metric/collector/issue_count.godeleted file mode 100644index 6a24da44ec..0000000000--- a/backend/metric/collector/issue_count.go+++ /dev/null@@ -1,37 +0,0 @@-package collector--import (- "context"-- metricapi "github.com/bytebase/bytebase/backend/metric"- "github.com/bytebase/bytebase/backend/plugin/metric"- "github.com/bytebase/bytebase/backend/store"-)--var _ metric.Collector = (*issueCountCollector)(nil)--// issueCountCollector is the metric data collector for issue.-type issueCountCollector struct {- store *store.Store-}--// NewIssueCountCollector creates a new instance of issueCollector.-func NewIssueCountCollector(store *store.Store) metric.Collector {- return &issueCountCollector{- store: store,- }-}--// Collect will collect the metric for issue.-func (c *issueCountCollector) Collect(ctx context.Context) ([]*metric.Metric, error) {- count, err := c.store.CountIssues(ctx)- if err != nil {- return nil, err- }- return []*metric.Metric{- {- Name: metricapi.IssueCountMetricName,- Value: count,- },- }, nil-}diff --git a/backend/metric/collector/project_count.go b/backend/metric/collector/project_count.godeleted file mode 100644index d3dc8cb184..0000000000--- a/backend/metric/collector/project_count.go+++ /dev/null@@ -1,37 +0,0 @@-package collector--import (- "context"-- metricapi "github.com/bytebase/bytebase/backend/metric"- "github.com/bytebase/bytebase/backend/plugin/metric"- "github.com/bytebase/bytebase/backend/store"-)--var _ metric.Collector = (*projectCountCollector)(nil)--// projectCountCollector is the metric data collector for project.-type projectCountCollector struct {- store *store.Store-}--// NewProjectCountCollector creates a new instance of projectCollector.-func NewProjectCountCollector(store *store.Store) metric.Collector {- return &projectCountCollector{- store: store,- }-}--// Collect will collect the metric for project.-func (c *projectCountCollector) Collect(ctx context.Context) ([]*metric.Metric, error) {- count, err := c.store.CountProjects(ctx)- if err != nil {- return nil, err- }- return []*metric.Metric{- {- Name: metricapi.ProjectCountMetricName,- Value: count,- },- }, nil-}diff --git a/backend/metric/collector/user_count.go b/backend/metric/collector/user_count.godeleted file mode 100644index e5a433afa6..0000000000--- a/backend/metric/collector/user_count.go+++ /dev/null@@ -1,50 +0,0 @@-package collector--import (- "context"-- storepb "github.com/bytebase/bytebase/backend/generated-go/store"- metricapi "github.com/bytebase/bytebase/backend/metric"- "github.com/bytebase/bytebase/backend/plugin/metric"- "github.com/bytebase/bytebase/backend/store"-)--var _ metric.Collector = (*userCountCollector)(nil)--// userCountCollector is the metric data collector for user.-type userCountCollector struct {- store *store.Store-}--// NewUserCountCollector creates a new instance of userCountCollector.-func NewUserCountCollector(store *store.Store) metric.Collector {- return &userCountCollector{- store: store,- }-}--// Collect will collect the metric for user.-func (c *userCountCollector) Collect(ctx context.Context) ([]*metric.Metric, error) {- userStat, err := c.store.StatUsers(ctx)- if err != nil {- return nil, err- }-- metrics := []*metric.Metric{}- for _, stat := range userStat {- if stat.Type == storepb.PrincipalType_END_USER {- metrics = append(metrics, &metric.Metric{- Name: metricapi.UserCountMetricName,- Value: stat.Count,- })- }- if stat.Type == storepb.PrincipalType_SERVICE_ACCOUNT {- metrics = append(metrics, &metric.Metric{- Name: metricapi.ServiceAccountCountMetricName,- Value: stat.Count,- })- }- }-- return metrics, nil-}diff --git a/backend/metric/metric.go b/backend/metric/metric.godeleted file mode 100644index cbcc53dd11..0000000000--- a/backend/metric/metric.go+++ /dev/null@@ -1,49 +0,0 @@-// Package metric provides the API definition for metrics.-package metric--import (- storepb "github.com/bytebase/bytebase/backend/generated-go/store"- "github.com/bytebase/bytebase/backend/plugin/metric"-)--const (- // InstanceCountMetricName is the metric name for instance count.- InstanceCountMetricName metric.Name = "bb.instance.count"- // IssueCountMetricName is the metric name for issue count.- IssueCountMetricName metric.Name = "bb.issue.count"- // ProjectCountMetricName is the metric name for project count.- ProjectCountMetricName metric.Name = "bb.project.count"- // UserCountMetricName is the metric name for user count.- UserCountMetricName metric.Name = "bb.user.count"- // ServiceAccountCountMetricName is the metric name for service account count.- ServiceAccountCountMetricName metric.Name = "bb.service-account.count"- // OpenAPIMetricName is the metric name for OpenAPI.- OpenAPIMetricName metric.Name = "bb.api.call"- // PrincipalRegistrationMetricName is the metric name for the principal registration event.- PrincipalRegistrationMetricName metric.Name = "bb.principal.registration"- // PrincipalLoginMetricName is the metric name for principal login event.- PrincipalLoginMetricName metric.Name = "bb.principal.login"- // IssueCreateMetricName is the metric name for issue creation event.- IssueCreateMetricName metric.Name = "bb.issue.create"- // APIRequestMetricName is the metric name for api request.- APIRequestMetricName metric.Name = "bb.api.request"- // InstanceCreateMetricName is the metric name for instance creation event.- InstanceCreateMetricName metric.Name = "bb.instance.create"-)--// InstanceCountMetric is the API message for bb.instance.count.-type InstanceCountMetric struct {- Engine storepb.Engine- EnvironmentID string- Count int-}--// IssueCountMetric is the API message for bb.issue.count.-type IssueCountMetric struct {- Count int-}--// ProjectCountMetric is the API message for project count metric.-type ProjectCountMetric struct {- Count int-}diff --git a/backend/plugin/metric/collector.go b/backend/plugin/metric/collector.godeleted file mode 100644index 9aa02980a3..0000000000--- a/backend/plugin/metric/collector.go+++ /dev/null@@ -1,10 +0,0 @@-package metric--import (- "context"-)--// Collector is the API message for metric collector.-type Collector interface {- Collect(ctx context.Context) ([]*Metric, error)-}diff --git a/backend/plugin/metric/metric.go b/backend/plugin/metric/metric.godeleted file mode 100644index dbbfb534fd..0000000000--- a/backend/plugin/metric/metric.go+++ /dev/null@@ -1,20 +0,0 @@-// Package metric is the interfaces for telemetry metrics.-package metric--// Name is the metric name.-type Name string--// Metric is the API message for metric.-type Metric struct {- Name Name- Value int- Labels map[string]any-}--// Identifier is the identifier for metric.-type Identifier struct {- ID string- Email string- Name string- Labels map[string]string-}diff --git a/backend/plugin/metric/reporter.go b/backend/plugin/metric/reporter.godeleted file mode 100644index e7ec855d3c..0000000000--- a/backend/plugin/metric/reporter.go+++ /dev/null@@ -1,8 +0,0 @@-package metric--// Reporter is the API message for metric reporter.-type Reporter interface {- Close()- Report(id string, metric *Metric) error- Identify(identifier *Identifier) error-}diff --git a/backend/plugin/metric/segment/mock.go b/backend/plugin/metric/segment/mock.godeleted file mode 100644index ffe02a4276..0000000000--- a/backend/plugin/metric/segment/mock.go+++ /dev/null@@ -1,26 +0,0 @@-package segment--import "github.com/bytebase/bytebase/backend/plugin/metric"--// mockreporter is the metrics collector https://segment.com/.-type mockreporter struct {-}--// NewMockReporter creates a new instance of segment mock reporter.-func NewMockReporter() metric.Reporter {- return &mockreporter{}-}--// Close will close the segment client.-func (*mockreporter) Close() {-}--// Report will exec all the segment reporter.-func (*mockreporter) Report(_ string, _ *metric.Metric) error {- return nil-}--// Identify will identify the workspace with license.-func (*mockreporter) Identify(_ *metric.Identifier) error {- return nil-}diff --git a/backend/plugin/metric/segment/reporter.go b/backend/plugin/metric/segment/reporter.godeleted file mode 100644index 5a730daef9..0000000000--- a/backend/plugin/metric/segment/reporter.go+++ /dev/null@@ -1,86 +0,0 @@-// Package segment implements the reporter for segment.-package segment--import (- "log/slog"- "time"-- "github.com/bytebase/bytebase/backend/common/log"- "github.com/bytebase/bytebase/backend/plugin/metric"-- "github.com/segmentio/analytics-go"-)--var _ metric.Reporter = (*reporter)(nil)--// reporter is the metrics collector https://segment.com/.-type reporter struct {- client analytics.Client-}--const (- // metricValueField is the property key for value.- metricValueField = "value"-)--// NewReporter creates a new instance of segment.-func NewReporter(key string) metric.Reporter {- client, err := analytics.NewWithConfig(key, analytics.Config{- Logger: &sinkLogger{},- })- if err != nil {- slog.Error("failed to create reporter", log.BBError(err))- client = analytics.New(key)- }-- return &reporter{- client: client,- }-}--// Close will close the segment client.-func (r *reporter) Close() {- r.client.Close()-}--// Report will exec all the segment reporter.-func (r *reporter) Report(id string, metric *metric.Metric) error {- properties := analytics.NewProperties().- Set(metricValueField, metric.Value)-- for key, value := range metric.Labels {- properties.Set(key, value)- }-- return r.client.Enqueue(analytics.Track{- Event: string(metric.Name),- UserId: id,- Properties: properties,- Timestamp: time.Now().UTC(),- })-}--// Identify will identify the workspace with license.-func (r *reporter) Identify(identifier *metric.Identifier) error {- traits := analytics.NewTraits()- traits.SetEmail(identifier.Email)- traits.SetName(identifier.Name)- for key, value := range identifier.Labels {- traits.Set(key, value)- }-- return r.client.Enqueue(analytics.Identify{- UserId: identifier.ID,- Traits: traits,- Timestamp: time.Now().UTC(),- })-}--type sinkLogger struct {-}--func (sinkLogger) Logf(string, ...any) {-}--func (sinkLogger) Errorf(string, ...any) {-}diff --git a/backend/runner/metricreport/reporter.go b/backend/runner/metricreport/reporter.godeleted file mode 100644index 929ab9409b..0000000000--- a/backend/runner/metricreport/reporter.go+++ /dev/null@@ -1,252 +0,0 @@-// Package metricreport is a runner reporting metrics.-package metricreport--import (- "context"- "fmt"- "log/slog"- "sync"- "time"-- "github.com/pkg/errors"-- "github.com/bytebase/bytebase/backend/common"- "github.com/bytebase/bytebase/backend/common/log"- "github.com/bytebase/bytebase/backend/component/config"- "github.com/bytebase/bytebase/backend/enterprise"-- v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"- "github.com/bytebase/bytebase/backend/plugin/metric"- "github.com/bytebase/bytebase/backend/plugin/metric/segment"- "github.com/bytebase/bytebase/backend/store"-)--const (- metricSchedulerInterval = 6 * time.Hour- // identifyTraitForPlan is the trait key for subscription plan.- identifyTraitForPlan = "plan"- // identifyTraitForTrial is the trait key for trialing.- identifyTraitForTrial = "trial"- // identifyTraitForSubscriptionStartDate is the trait key for subscription start date.- identifyTraitForSubscriptionStartDate = "subscription_start"- // identifyTraitForSubscriptionEndDate is the trait key for subscription end date.- identifyTraitForSubscriptionEndDate = "subscription_end"- // identifyTraitForOrgID is the trait key for organization id.- identifyTraitForOrgID = "org_id"- // identifyTraitForOrgName is the trait key for organization name.- identifyTraitForOrgName = "org_name"- // identifyTraitForMode is the trait key for Bytebase service mode.- identifyTraitForMode = "mode"- // identifyTraitForLastActiveTime is the trait key for Bytebase last active time.- identifyTraitForLastActiveTime = "last_active"- // identifyTraitForVersion is the trait key for Bytebase version.- identifyTraitForVersion = "version"- // bytebaseServiceModeSaaS is the mode for Bytebase SaaS.- bytebaseServiceModeSaaS = "saas"- // bytebaseServiceModeSelfhost is the mode for Bytebase self-host.- bytebaseServiceModeSelfhost = "self-host"-)--// Reporter is the metric reporter.-type Reporter struct {- licenseService *enterprise.LicenseService- profile *config.Profile- reporter metric.Reporter- collectors map[string]metric.Collector- store *store.Store-}--// NewReporter creates a new metric scheduler.-func NewReporter(store *store.Store, licenseService *enterprise.LicenseService, profile *config.Profile) *Reporter {- var r metric.Reporter- if profile.MetricConnectionKey != "" {- r = segment.NewReporter(profile.MetricConnectionKey)- } else {- r = segment.NewMockReporter()- }-- return &Reporter{- licenseService: licenseService,- profile: profile,- reporter: r,- collectors: make(map[string]metric.Collector),- store: store,- }-}--// Run will run the metric reporter.-func (m *Reporter) Run(ctx context.Context, wg *sync.WaitGroup) {- ticker := time.NewTicker(metricSchedulerInterval)- defer ticker.Stop()- defer wg.Done()-- slog.Debug(fmt.Sprintf("Metrics reporter started and will run every %v", metricSchedulerInterval))-- for {- select {- case <-ticker.C:- go func() {- defer func() {- if r := recover(); r != nil {- err, ok := r.(error)- if !ok {- err = errors.Errorf("%v", r)- }- slog.Error("Metrics reporter PANIC RECOVER", log.BBError(err), log.BBStack("panic-stack"))- }- }()-- ctx := context.Background()-- // Check if metric collection is enabled in workspace profile setting- if !m.isMetricCollectionEnabled(ctx) {- return- }-- // identify will be triggered in every schedule loop so that we can update the latest workspace profile such as subscription plan.- workspaceID, err := m.identify(ctx)- if err != nil {- slog.Error("failed to report identifier", log.BBError(err))- return- }-- for name, collector := range m.collectors {- slog.Debug("Run metric collector", slog.String("collector", name))-- metricList, err := collector.Collect(ctx)- if err != nil {- slog.Error(- "Failed to collect metric",- slog.String("collector", name),- log.BBError(err),- )- continue- }-- for _, metric := range metricList {- m.reportMetric(workspaceID, metric)- }- }- }()- case <-ctx.Done(): // if cancel() execute- return- }- }-}--// Close will close the metric reporter.-func (m *Reporter) Close() {- m.reporter.Close()-}--// Register will register a metric collector.-func (m *Reporter) Register(metricName metric.Name, collector metric.Collector) {- m.collectors[string(metricName)] = collector-}--func (m *Reporter) reportMetric(id string, metric *metric.Metric) {- if err := m.reporter.Report(id, metric); err != nil {- slog.Error(- "Failed to report metric",- slog.String("metric", string(metric.Name)),- log.BBError(err),- )- }-}--// isMetricCollectionEnabled checks if metric collection is enabled in workspace profile setting.-func (m *Reporter) isMetricCollectionEnabled(ctx context.Context) bool {- // Always disable metrics in demo mode- if m.profile.Demo {- return false- }-- // No connection key means no metrics- if m.profile.MetricConnectionKey == "" {- return false- }-- // Get workspace profile setting- workspaceProfile, err := m.store.GetWorkspaceProfileSetting(ctx)- if err != nil {- // If we can't get the setting, default to enabled for backward compatibility- slog.Debug("Failed to get workspace profile setting for metric collection", log.BBError(err))- return true- }-- return workspaceProfile.EnableMetricCollection-}--// Identify will identify the workspace and update the subscription plan.-func (m *Reporter) identify(ctx context.Context) (string, error) {- systemSetting, err := m.store.GetSystemSetting(ctx)- if err != nil {- return "", errors.Wrap(err, "failed to get system setting")- }- workspaceID := systemSetting.WorkspaceId- subscription := m.licenseService.LoadSubscription(ctx)- plan := subscription.Plan.String()- orgID := ""- orgName := ""-- trial := "N"- if subscription.Trialing {- trial = "Y"- }-- subscriptionStartDate := ""- subscriptionEndDate := ""- if subscription.Plan != v1pb.PlanType_FREE && subscription.ExpiresTime != nil {- subscriptionEndDate = subscription.ExpiresTime.AsTime().Format(time.RFC3339)- }-- user, err := m.store.GetUserByID(ctx, common.PrincipalIDForFirstUser)- if err != nil {- slog.Debug("unable to get the first principal user", slog.Int("id", common.PrincipalIDForFirstUser), log.BBError(err))- }- email := ""- name := ""- if user != nil {- email = user.Email- name = user.Name- }-- mode := bytebaseServiceModeSelfhost- if m.profile.SaaS {- mode = bytebaseServiceModeSaaS- }-- if err := m.reporter.Identify(&metric.Identifier{- ID: workspaceID,- Email: email,- Name: name,- Labels: map[string]string{- identifyTraitForPlan: plan,- identifyTraitForTrial: trial,- identifyTraitForVersion: m.profile.Version,- identifyTraitForOrgID: orgID,- identifyTraitForOrgName: orgName,- identifyTraitForMode: mode,- identifyTraitForLastActiveTime: time.Unix(m.profile.LastActiveTS.Load(), 0).String(),- identifyTraitForSubscriptionStartDate: subscriptionStartDate,- identifyTraitForSubscriptionEndDate: subscriptionEndDate,- },- }); err != nil {- return workspaceID, err- }-- return workspaceID, nil-}--// Report will report a metric.-func (m *Reporter) Report(ctx context.Context, metric *metric.Metric) {- systemSetting, err := m.store.GetSystemSetting(ctx)- var workspaceID string- if err != nil {- slog.Error("failed to get system setting", log.BBError(err))- // On error, workspaceID remains its zero value (empty string), matching original behavior.- } else {- workspaceID = systemSetting.WorkspaceId- }- m.reportMetric(workspaceID, metric)-}diff --git a/backend/server/grpc_routes.go b/backend/server/grpc_routes.goindex 502b55f42b..98fbd6cac0 100644--- a/backend/server/grpc_routes.go+++ b/backend/server/grpc_routes.go@@ -32,7 +32,6 @@ import ("github.com/bytebase/bytebase/backend/enterprise"v1pb "github.com/bytebase/bytebase/backend/generated-go/v1""github.com/bytebase/bytebase/backend/generated-go/v1/v1connect"- "github.com/bytebase/bytebase/backend/runner/metricreport""github.com/bytebase/bytebase/backend/runner/schemasync""github.com/bytebase/bytebase/backend/store")@@ -45,7 +44,6 @@ func configureGrpcRouters(dbFactory *dbfactory.DBFactory,licenseService *enterprise.LicenseService,profile *config.Profile,- metricReporter *metricreport.Reporter,stateCfg *state.State,schemaSyncer *schemasync.Syncer,webhookManager *webhook.Manager,@@ -73,7 +71,7 @@ func configureGrpcRouters()actuatorService := apiv1.NewActuatorService(stores, profile, schemaSyncer, licenseService, sampleInstanceManager)auditLogService := apiv1.NewAuditLogService(stores, iamManager, licenseService)- authService := apiv1.NewAuthService(stores, secret, licenseService, metricReporter, profile, stateCfg, iamManager)+ authService := apiv1.NewAuthService(stores, secret, licenseService, profile, stateCfg, iamManager)celService := apiv1.NewCelService()databaseCatalogService := apiv1.NewDatabaseCatalogService(stores, licenseService)databaseGroupService := apiv1.NewDatabaseGroupService(stores, profile, iamManager, licenseService)@@ -81,8 +79,8 @@ func configureGrpcRouters(groupService := apiv1.NewGroupService(stores, iamManager, licenseService)identityProviderService := apiv1.NewIdentityProviderService(stores, licenseService, profile)instanceRoleService := apiv1.NewInstanceRoleService(stores, dbFactory)- instanceService := apiv1.NewInstanceService(stores, profile, licenseService, metricReporter, stateCfg, dbFactory, schemaSyncer, iamManager, sampleInstanceManager)- issueService := apiv1.NewIssueService(stores, webhookManager, stateCfg, licenseService, profile, iamManager, metricReporter)+ instanceService := apiv1.NewInstanceService(stores, profile, licenseService, stateCfg, dbFactory, schemaSyncer, iamManager, sampleInstanceManager)+ issueService := apiv1.NewIssueService(stores, webhookManager, stateCfg, licenseService, profile, iamManager)orgPolicyService := apiv1.NewOrgPolicyService(stores, licenseService)planService := apiv1.NewPlanService(stores, sheetManager, licenseService, dbFactory, stateCfg, profile, iamManager)projectService := apiv1.NewProjectService(stores, profile, iamManager, licenseService)@@ -94,8 +92,8 @@ func configureGrpcRouters(settingService := apiv1.NewSettingService(stores, profile, licenseService, stateCfg)sheetService := apiv1.NewSheetService(stores, sheetManager, licenseService, iamManager, profile)sqlService := apiv1.NewSQLService(stores, sheetManager, schemaSyncer, dbFactory, licenseService, profile, iamManager)- subscriptionService := apiv1.NewSubscriptionService(stores, profile, metricReporter, licenseService)- userService := apiv1.NewUserService(stores, secret, licenseService, metricReporter, profile, stateCfg, iamManager)+ subscriptionService := apiv1.NewSubscriptionService(stores, profile, licenseService)+ userService := apiv1.NewUserService(stores, secret, licenseService, profile, stateCfg, iamManager)worksheetService := apiv1.NewWorksheetService(stores, iamManager)workspaceService := apiv1.NewWorkspaceService(stores, iamManager)@@ -112,7 +110,6 @@ func configureGrpcRouters(handlerOpts := connect.WithHandlerOptions(connect.WithInterceptors(validateInterceptor,- apiv1.NewDebugInterceptor(metricReporter),auth.New(stores, secret, licenseService, stateCfg, profile),apiv1.NewACLInterceptor(stores, secret, iamManager, profile),apiv1.NewAuditInterceptor(stores, secret, profile),diff --git a/backend/server/server.go b/backend/server/server.goindex a348d7f7f8..f6ce1b0dc7 100644--- a/backend/server/server.go+++ b/backend/server/server.go@@ -32,13 +32,10 @@ import ("github.com/bytebase/bytebase/backend/enterprise"storepb "github.com/bytebase/bytebase/backend/generated-go/store"v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"- "github.com/bytebase/bytebase/backend/metric"- metriccollector "github.com/bytebase/bytebase/backend/metric/collector""github.com/bytebase/bytebase/backend/migrator""github.com/bytebase/bytebase/backend/resources/postgres""github.com/bytebase/bytebase/backend/runner/approval""github.com/bytebase/bytebase/backend/runner/cleaner"- "github.com/bytebase/bytebase/backend/runner/metricreport""github.com/bytebase/bytebase/backend/runner/monitor""github.com/bytebase/bytebase/backend/runner/plancheck""github.com/bytebase/bytebase/backend/runner/schemasync"@@ -60,7 +57,6 @@ type Server struct {// Asynchronous runners.taskScheduler *taskrun.SchedulerplanCheckScheduler *plancheck.Scheduler- metricReporter *metricreport.ReporterschemaSyncer *schemasync.SyncerapprovalRunner *approval.RunnerdataCleaner *cleaner.DataCleaner@@ -188,7 +184,6 @@ func NewServer(ctx context.Context, profile *config.Profile) (*Server, error) {// Configure echo server.s.echoServer = echo.New()- s.metricReporter = metricreport.NewReporter(s.store, s.licenseService, s.profile)s.schemaSyncer = schemasync.NewSyncer(stores, s.dbFactory, s.profile, s.stateCfg, s.licenseService)s.approvalRunner = approval.NewRunner(stores, sheetManager, s.dbFactory, s.stateCfg, s.webhookManager, s.licenseService)@@ -211,9 +206,6 @@ func NewServer(ctx context.Context, profile *config.Profile) (*Server, error) {// Data cleaners.dataCleaner = cleaner.NewDataCleaner(stores)- // Metric reporter- s.initMetricReporter()-// LSP server.s.lspServer = lsp.NewServer(s.store, profile, secret, s.stateCfg, s.iamManager, s.licenseService)@@ -224,7 +216,7 @@ func NewServer(ctx context.Context, profile *config.Profile) (*Server, error) {return nil, errors.Wrapf(err, "failed to create MCP server")}- if err := configureGrpcRouters(ctx, s.echoServer, s.store, sheetManager, s.dbFactory, s.licenseService, s.profile, s.metricReporter, s.stateCfg, s.schemaSyncer, s.webhookManager, s.iamManager, secret, s.sampleInstanceManager); err != nil {+ if err := configureGrpcRouters(ctx, s.echoServer, s.store, sheetManager, s.dbFactory, s.licenseService, s.profile, s.stateCfg, s.schemaSyncer, s.webhookManager, s.iamManager, secret, s.sampleInstanceManager); err != nil {return nil, errors.Wrapf(err, "failed to configure gRPC routers")}configureEchoRouters(s.echoServer, s.lspServer, directorySyncServer, oauth2Service, mcpServer, profile)@@ -245,9 +237,6 @@ func (s *Server) Run(ctx context.Context, port int) error {s.runnerWG.Add(1)go s.approvalRunner.Run(ctx, &s.runnerWG)- s.runnerWG.Add(1)- go s.metricReporter.Run(ctx, &s.runnerWG)-s.runnerWG.Add(1)go s.planCheckScheduler.Run(ctx, &s.runnerWG)@@ -295,11 +284,6 @@ func (s *Server) Shutdown(ctx context.Context) error {slog.Info("Stopping Bytebase...")slog.Info("Stopping web server...")- // Close the metric reporter- if s.metricReporter != nil {- s.metricReporter.Close()- }-ctx, cancel := context.WithTimeout(ctx, gracefulShutdownPeriod)defer cancel()@@ -337,12 +321,3 @@ func (s *Server) Shutdown(ctx context.Context) error {return nil}--// initMetricReporter initializes the metric reporter.-func (s *Server) initMetricReporter() {- s.metricReporter = metricreport.NewReporter(s.store, s.licenseService, s.profile)- s.metricReporter.Register(metric.InstanceCountMetricName, metriccollector.NewInstanceCountCollector(s.store))- s.metricReporter.Register(metric.IssueCountMetricName, metriccollector.NewIssueCountCollector(s.store))- s.metricReporter.Register(metric.ProjectCountMetricName, metriccollector.NewProjectCountCollector(s.store))- s.metricReporter.Register(metric.UserCountMetricName, metriccollector.NewUserCountCollector(s.store))-}diff --git a/backend/store/stats.go b/backend/store/stats.goindex 16acc9a83a..1e673069e2 100644--- a/backend/store/stats.go+++ b/backend/store/stats.go@@ -9,7 +9,6 @@ import ("github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/common/qb"storepb "github.com/bytebase/bytebase/backend/generated-go/store"- "github.com/bytebase/bytebase/backend/metric")// CountInstanceMessage is the message for counting instances.@@ -98,97 +97,3 @@ func (s *Store) CountActiveUsers(ctx context.Context) (int, error) {}return count, nil}--// CountProjects counts the number of projects and group by workflow type.-// Used by the metric collector.-func (s *Store) CountProjects(ctx context.Context) (int, error) {- tx, err := s.GetDB().BeginTx(ctx, nil)- if err != nil {- return 0, err- }- defer tx.Rollback()-- q := qb.Q().Space("SELECT COUNT(1) FROM project WHERE deleted = FALSE")- query, args, err := q.ToSQL()- if err != nil {- return 0, errors.Wrapf(err, "failed to build sql")- }-- var count int- if err := tx.QueryRowContext(ctx, query, args...).Scan(&count); err != nil {- return 0, err- }- if err := tx.Commit(); err != nil {- return 0, err- }- return count, nil-}--// CountIssues counts the number of issues.-// Used by the metric collector.-func (s *Store) CountIssues(ctx context.Context) (int, error) {- tx, err := s.GetDB().BeginTx(ctx, nil)- if err != nil {- return 0, err- }- defer tx.Rollback()-- q := qb.Q().Space("SELECT COUNT(1) FROM issue WHERE id > ?", 101)- query, args, err := q.ToSQL()- if err != nil {- return 0, errors.Wrapf(err, "failed to build sql")- }-- var count int- if err := tx.QueryRowContext(ctx, query, args...).Scan(&count); err != nil {- return 0, err- }- if err := tx.Commit(); err != nil {- return 0, err- }- return count, nil-}--// CountInstanceGroupByEngineAndEnvironmentID counts the number of instances and group by engine and environment.-// Used by the metric collector.-func (s *Store) CountInstanceGroupByEngineAndEnvironmentID(ctx context.Context) ([]*metric.InstanceCountMetric, error) {- tx, err := s.GetDB().BeginTx(ctx, nil)- if err != nil {- return nil, err- }- defer tx.Rollback()-- q := qb.Q().Space("SELECT metadata->>'engine' AS engine, environment, COUNT(1) FROM instance WHERE id > ? AND deleted = FALSE GROUP BY engine, environment", 101)- query, args, err := q.ToSQL()- if err != nil {- return nil, errors.Wrapf(err, "failed to build sql")- }-- rows, err := tx.QueryContext(ctx, query, args...)- if err != nil {- return nil, err- }- defer rows.Close()-- var res []*metric.InstanceCountMetric- for rows.Next() {- var metric metric.InstanceCountMetric- var engine string- if err := rows.Scan(&engine, &metric.EnvironmentID, &metric.Count); err != nil {- return nil, err- }- engineTypeValue, ok := storepb.Engine_value[engine]- if !ok {- return nil, errors.Errorf("invalid engine %s", engine)- }- metric.Engine = storepb.Engine(engineTypeValue)- res = append(res, &metric)- }- if err := rows.Err(); err != nil {- return nil, err- }- if err := tx.Commit(); err != nil {- return nil, err- }- return res, nil-}diff --git a/go.mod b/go.modindex 8cb426d76a..295bee8cb8 100644--- a/go.mod+++ b/go.mod@@ -77,7 +77,6 @@ require (github.com/pingcap/tidb/pkg/parser v0.0.0-20241125141335-ec8b81b98edcgithub.com/pkg/errors v0.9.1github.com/redis/go-redis/v9 v9.17.2- github.com/segmentio/analytics-go v3.1.0+incompatiblegithub.com/shopspring/decimal v1.4.0github.com/sijms/go-ora/v2 v2.9.0github.com/snowflakedb/gosnowflake v1.18.0@@ -358,7 +357,6 @@ require (github.com/prometheus/common v0.66.1 // indirectgithub.com/prometheus/procfs v0.16.1 // indirectgithub.com/segmentio/asm v1.2.1 // indirect- github.com/segmentio/backo-go v1.0.1 // indirectgithub.com/shirou/gopsutil/v3 v3.24.5 // indirectgithub.com/siddontang/go v0.0.0-20180604090527-bdc77568d726 // indirectgithub.com/siddontang/go-log v0.0.0-20190221022429-1e957dd83bed // indirect@@ -371,7 +369,6 @@ require (github.com/xdg-go/pbkdf2 v1.0.0 // indirectgithub.com/xdg-go/scram v1.1.2 // indirectgithub.com/xdg-go/stringprep v1.0.4 // indirect- github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c // indirectgithub.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78github.com/yusufpapurcu/wmi v1.2.4 // indirectgo.opencensus.io v0.24.0 // indirectdiff --git a/go.sum b/go.sumindex 0ad0066fe7..8bdf6e53ff 100644--- a/go.sum+++ b/go.sum@@ -1694,12 +1694,8 @@ github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHgithub.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU=github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U=github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=-github.com/segmentio/analytics-go v3.1.0+incompatible h1:IyiOfUgQFVHvsykKKbdI7ZsH374uv3/DfZUo9+G0Z80=-github.com/segmentio/analytics-go v3.1.0+incompatible/go.mod h1:C7CYBtQWk4vRk2RyLu0qOcbHJ18E3F1HV2C/8JvKN48=github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=-github.com/segmentio/backo-go v1.0.1 h1:68RQccglxZeyURy93ASB/2kc9QudzgIDexJ927N++y4=-github.com/segmentio/backo-go v1.0.1/go.mod h1:9/Rh6yILuLysoQnZ2oNooD2g7aBnvM7r/fNVxRNWfBc=github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=github.com/shirou/gopsutil/v3 v3.21.12/go.mod h1:BToYZVTlSVlfazpDDYFnsVZLaoRG+g8ufT6fPQLdJzA=@@ -1842,8 +1838,6 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHogithub.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=-github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c h1:3lbZUMbMiGUW/LMkfsEABsc5zNT9+b1CvsJx47JzJ8g=-github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c/go.mod h1:UrdRz5enIKZ63MEE3IF9l2/ebyx59GyGgPi+tICQdmM=github.com/xuri/efp v0.0.1 h1:fws5Rv3myXyYni8uwj2qKjVaRP30PdjeYe2Y6FDsCL8=github.com/xuri/efp v0.0.1/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=github.com/xuri/excelize/v2 v2.10.0 h1:8aKsP7JD39iKLc6dH5Tw3dgV3sPRh8uRVXu/fMstfW4=