SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
chore: analtics changed after rbac (#1058)
Ankit Nayan2dcc6fda7764
diff --git a/pkg/query-service/app/http_handler.go b/pkg/query-service/app/http_handler.goindex 42bfc3b78c..2ab1845c37 100644--- a/pkg/query-service/app/http_handler.go+++ b/pkg/query-service/app/http_handler.go@@ -263,8 +263,6 @@ func (aH *APIHandler) RegisterRoutes(router *mux.Router) {router.HandleFunc("/api/v1/dashboards/{uuid}", EditAccess(aH.updateDashboard)).Methods(http.MethodPut)router.HandleFunc("/api/v1/dashboards/{uuid}", EditAccess(aH.deleteDashboard)).Methods(http.MethodDelete)- router.HandleFunc("/api/v1/user", ViewAccess(aH.user)).Methods(http.MethodPost)-router.HandleFunc("/api/v1/feedback", OpenAccess(aH.submitFeedback)).Methods(http.MethodPost)// router.HandleFunc("/api/v1/get_percentiles", aH.getApplicationPercentiles).Methods(http.MethodGet)router.HandleFunc("/api/v1/services", ViewAccess(aH.getServices)).Methods(http.MethodPost)@@ -863,25 +861,6 @@ func (aH *APIHandler) submitFeedback(w http.ResponseWriter, r *http.Request) {}-func (aH *APIHandler) user(w http.ResponseWriter, r *http.Request) {-- user, err := parseUser(r)- if err != nil {- if aH.handleError(w, err, http.StatusBadRequest) {- return- }- }-- telemetry.GetInstance().IdentifyUser(user)- data := map[string]interface{}{- "name": user.Name,- "email": user.Email,- "organizationName": user.OrgId,- }- telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_USER, data)--}-func (aH *APIHandler) getTopEndpoints(w http.ResponseWriter, r *http.Request) {query, err := parseGetTopEndpointsRequest(r)@@ -1507,10 +1486,12 @@ func (aH *APIHandler) editOrg(w http.ResponseWriter, r *http.Request) {}data := map[string]interface{}{- "hasOptedUpdates": req.HasOptedUpdates,- "isAnonymous": req.IsAnonymous,+ "hasOptedUpdates": req.HasOptedUpdates,+ "isAnonymous": req.IsAnonymous,+ "organizationName": req.Name,}- telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_USER_PREFERENCES, data)++ telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_ORG_SETTINGS, data)aH.writeJSON(w, r, map[string]string{"data": "org updated successfully"})}diff --git a/pkg/query-service/dao/sqlite/connection.go b/pkg/query-service/dao/sqlite/connection.goindex 08bc210e4f..b66ddeec12 100644--- a/pkg/query-service/dao/sqlite/connection.go+++ b/pkg/query-service/dao/sqlite/connection.go@@ -113,7 +113,6 @@ func (mds *ModelDaoSqlite) initializeOrgPreferences(ctx context.Context) error {}// set telemetry fields from userPreferences- telemetry.GetInstance().SetTelemetryAnonymous(org.IsAnonymous)telemetry.GetInstance().SetDistinctId(org.Id)return nildiff --git a/pkg/query-service/dao/sqlite/rbac.go b/pkg/query-service/dao/sqlite/rbac.goindex b71d19b1cb..9c74f812c2 100644--- a/pkg/query-service/dao/sqlite/rbac.go+++ b/pkg/query-service/dao/sqlite/rbac.go@@ -188,6 +188,14 @@ func (mds *ModelDaoSqlite) CreateUser(ctx context.Context,if err != nil {return nil, &model.ApiError{Typ: model.ErrorInternal, Err: err}}++ data := map[string]interface{}{+ "name": user.Name,+ "email": user.Email,+ }+ telemetry.GetInstance().IdentifyUser(user)+ telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_USER, data)+return user, nil}diff --git a/pkg/query-service/telemetry/telemetry.go b/pkg/query-service/telemetry/telemetry.goindex 9dea99f94f..1f5360fa40 100644--- a/pkg/query-service/telemetry/telemetry.go+++ b/pkg/query-service/telemetry/telemetry.go@@ -19,7 +19,7 @@ const (TELEMETRY_EVENT_INPRODUCT_FEEDBACK = "InProduct Feeback Submitted"TELEMETRY_EVENT_NUMBER_OF_SERVICES = "Number of Services"TELEMETRY_EVENT_HEART_BEAT = "Heart Beat"- TELEMETRY_EVENT_USER_PREFERENCES = "User Preferences"+ TELEMETRY_EVENT_ORG_SETTINGS = "Org Settings")const api_key = "4Gmoa4ixJAUHx2BpJxsjwA1bEfnwEeRz"