mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 06:49:00 +08:00
chore: analtics changed after rbac (#1058)
This commit is contained in:
parent
a2f570d78c
commit
2dcc6fda77
@ -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"})
|
||||
}
|
||||
|
@ -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 nil
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user