The only tool you need to know what is happening and how to fix it.
Go alertingexception-trackerissue-trackinglogsmetricsmonitoringobservability-platformopen-telemetryotelsession-replaytelemetrytraces
one more hook
dduxda9959c148bd
diff --git a/backend/app/controllers/clientcontrollers/client.controller.go b/backend/app/controllers/clientcontrollers/client.controller.goindex 27bd7b12..578363ce 100644--- a/backend/app/controllers/clientcontrollers/client.controller.go+++ b/backend/app/controllers/clientcontrollers/client.controller.go@@ -32,6 +32,15 @@ func (e clientController) Report(c *gin.Context) {return}+ if project, exists := c.Get(middleware.ProjectContextKey); exists {+ if p, ok := project.(*models.Project); ok && p.OrganizationId != nil {+ if !hooks.CanReport(*p.OrganizationId) {+ c.AbortWithStatus(http.StatusTooManyRequests)+ return+ }+ }+ }+var request ReportRequestif err := c.ShouldBindBodyWithJSON(&request); err != nil {c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})diff --git a/backend/app/hooks/report_hooks.go b/backend/app/hooks/report_hooks.goindex 8ec57a4d..2b9f46bf 100644--- a/backend/app/hooks/report_hooks.go+++ b/backend/app/hooks/report_hooks.go@@ -29,3 +29,27 @@ func BroadcastReport(event ReportEvent) {hook(event)}}++type CanReportHook func(orgId int) bool++var (+ canReportHook CanReportHook+ canReportHookMu sync.RWMutex+)++func RegisterCanReportHook(fn CanReportHook) {+ canReportHookMu.Lock()+ defer canReportHookMu.Unlock()+ canReportHook = fn+}++func CanReport(orgId int) bool {+ canReportHookMu.RLock()+ hook := canReportHook+ canReportHookMu.RUnlock()++ if hook == nil {+ return true+ }+ return hook(orgId)+}