Ensure admins can send true up telemetry, even if telemetry is disabled.

Этот коммит содержится в:
Conor Macpherson
2023-04-11 12:52:54 -04:00
родитель 646e0fcd41
Коммит dd2e325c24
3 изменённых файлов: 11 добавлений и 9 удалений

Просмотреть файл

@@ -354,15 +354,18 @@ func requestTrueUpReview(c *Context, w http.ResponseWriter, r *http.Request) {
// Do not send true-up review data if the user has already requested one for the quarter.
// And only send a true-up review via as a one-time telemetry request if telemetry is disabled.
telemetryEnabled := c.App.Config().LogSettings.EnableDiagnostics
if telemetryEnabled != nil && !*telemetryEnabled {
if telemetryEnabled != nil && *telemetryEnabled {
// Send telemetry data
c.App.Srv().GetTelemetryService().SendTelemetry(model.TrueUpReviewTelemetryName, profileMap)
// Update the review status to reflect the completion.
status.Completed = true
c.App.Srv().Store().TrueUpReview().Update(status)
} else {
// Telemetry is disabled, submit true up review profile via CWS.
c.App.Cloud().SubmitTrueUpReview(profileMap)
}
// Update the review status to reflect the completion.
status.Completed = true
c.App.Srv().Store().TrueUpReview().Update(status)
// Encode to string rather than byte[] otherwise json.Marshal will encode it further.
encodedData := b64.StdEncoding.EncodeToString(profileMapJson)
responseContent := struct {

Просмотреть файл

@@ -48,4 +48,7 @@ type CloudInterface interface {
SelfServeDeleteWorkspace(userID string, deletionRequest *model.WorkspaceDeletionRequest) error
SubscribeToNewsletter(userID string, req *model.SubscribeNewsletterRequest) error
// Used only for when a customer has telemetry disabled. In this scenario, true up review telemetry will be submitted via CWS.
SubmitTrueUpReview(trueUpReviewProfile map[string]any) error
}

Просмотреть файл

@@ -223,10 +223,6 @@ const TrueUpReview: React.FC = () => {
return null;
}
if (telemetryEnabled) {
return null;
}
pageVisited(TELEMETRY_CATEGORIES.TRUE_UP_REVIEW, 'pageview_true_up_review');
return (