Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: issue reporter (#8114)
p0ny0393ce511e6e
diff --git a/backend/api/v1/issue_service.go b/backend/api/v1/issue_service.goindex 0d22d6b8bb..dea58f91be 100644--- a/backend/api/v1/issue_service.go+++ b/backend/api/v1/issue_service.go@@ -23,6 +23,9 @@ import ("github.com/bytebase/bytebase/backend/component/state"enterpriseAPI "github.com/bytebase/bytebase/backend/enterprise/api"api "github.com/bytebase/bytebase/backend/legacyapi"+ 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/runner/relay""github.com/bytebase/bytebase/backend/store""github.com/bytebase/bytebase/backend/utils"@@ -38,6 +41,7 @@ type IssueService struct {relayRunner *relay.RunnerstateCfg *state.StatelicenseService enterpriseAPI.LicenseService+ metricReporter *metricreport.Reporter}// NewIssueService creates a new IssueService.@@ -47,6 +51,7 @@ func NewIssueService(relayRunner *relay.Runner,stateCfg *state.State,licenseService enterpriseAPI.LicenseService,+ metricReporter *metricreport.Reporter,) *IssueService {return &IssueService{store: store,@@ -54,6 +59,7 @@ func NewIssueService(relayRunner: relayRunner,stateCfg: stateCfg,licenseService: licenseService,+ metricReporter: metricReporter,}}@@ -643,6 +649,14 @@ func (s *IssueService) createIssueGrantRequest(ctx context.Context, request *v1preturn nil, status.Errorf(codes.Internal, "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 converted, nil}diff --git a/backend/server/server.go b/backend/server/server.goindex 2bb71d128a..a9846d99dd 100644--- a/backend/server/server.go+++ b/backend/server/server.go@@ -609,7 +609,7 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {v1pb.RegisterSQLServiceServer(s.grpcServer, v1.NewSQLService(s.store, s.schemaSyncer, s.dbFactory, s.activityManager, s.licenseService))v1pb.RegisterExternalVersionControlServiceServer(s.grpcServer, v1.NewExternalVersionControlService(s.store))v1pb.RegisterRiskServiceServer(s.grpcServer, v1.NewRiskService(s.store, s.licenseService))- s.issueService = v1.NewIssueService(s.store, s.activityManager, s.relayRunner, s.stateCfg, s.licenseService)+ s.issueService = v1.NewIssueService(s.store, s.activityManager, s.relayRunner, s.stateCfg, s.licenseService, s.metricReporter)v1pb.RegisterIssueServiceServer(s.grpcServer, s.issueService)s.rolloutService = v1.NewRolloutService(s.store, s.licenseService, s.dbFactory, s.planCheckScheduler, s.stateCfg, s.activityManager)v1pb.RegisterRolloutServiceServer(s.grpcServer, s.rolloutService)