diff --git a/pkg/query-service/app/http_handler.go b/pkg/query-service/app/http_handler.go index 54e740577f..c46988760e 100644 --- a/pkg/query-service/app/http_handler.go +++ b/pkg/query-service/app/http_handler.go @@ -683,8 +683,9 @@ func (aH *APIHandler) user(w http.ResponseWriter, r *http.Request) { telemetry.GetInstance().IdentifyUser(user) data := map[string]interface{}{ - "name": user.Name, - "email": user.Email, + "name": user.Name, + "email": user.Email, + "organizationName": user.OrganizationName, } telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_USER, data) @@ -1108,6 +1109,12 @@ func (aH *APIHandler) setUserPreferences(w http.ResponseWriter, r *http.Request) return } + data := map[string]interface{}{ + "hasOptedUpdates": userParams.HasOptedUpdates, + "isAnonymous": userParams.IsAnonymous, + } + telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_USER_PREFERENCES, data) + aH.writeJSON(w, r, map[string]string{"data": "user preferences set successfully"}) } diff --git a/pkg/query-service/model/queryParams.go b/pkg/query-service/model/queryParams.go index d5ba693855..71782b3ec9 100644 --- a/pkg/query-service/model/queryParams.go +++ b/pkg/query-service/model/queryParams.go @@ -6,8 +6,9 @@ import ( ) type User struct { - Name string `json:"name"` - Email string `json:"email"` + Name string `json:"name"` + Email string `json:"email"` + OrganizationName string `json:"organizationName"` } type InstantQueryMetricsParams struct { diff --git a/pkg/query-service/telemetry/telemetry.go b/pkg/query-service/telemetry/telemetry.go index dd963e7910..5de8392e0c 100644 --- a/pkg/query-service/telemetry/telemetry.go +++ b/pkg/query-service/telemetry/telemetry.go @@ -18,6 +18,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" ) const api_key = "4Gmoa4ixJAUHx2BpJxsjwA1bEfnwEeRz"