Skip to content

Commit 2b1c7e1

Browse files
committed
installation-telemetry: propagate customerID setting control to CLI
1 parent 9bbd7bd commit 2b1c7e1

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

components/installation-telemetry/cmd/send.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,20 @@ var sendCmd = &cobra.Command{
5050
err = client.Close()
5151
}()
5252

53+
properties := analytics.NewProperties().
54+
Set("version", versionId).
55+
Set("totalUsers", data.TotalUsers).
56+
Set("totalWorkspaces", data.TotalWorkspaces).
57+
Set("totalInstances", data.TotalInstances)
58+
59+
if data.InstallationAdmin.Settings.SendCustomerID {
60+
properties.Set("customerID", data.CustomerID)
61+
}
62+
5363
telemetry := analytics.Track{
54-
UserId: data.InstallationAdmin.ID,
55-
Event: "Installation telemetry",
56-
Properties: analytics.NewProperties().
57-
Set("version", versionId).
58-
Set("totalUsers", data.TotalUsers).
59-
Set("totalWorkspaces", data.TotalWorkspaces).
60-
Set("totalInstances", data.TotalInstances).
61-
Set("customerID", data.CustomerID),
64+
UserId: data.InstallationAdmin.ID,
65+
Event: "Installation telemetry",
66+
Properties: properties,
6267
}
6368

6469
client.Enqueue(telemetry)

components/installation-telemetry/pkg/server/installationAdmin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import (
1414
)
1515

1616
type InstallationAdminSettings struct {
17-
SendTelemetry bool `json:"sendTelemetry"`
17+
SendTelemetry bool `json:"sendTelemetry"`
18+
SendCustomerID bool `json:"sendCustomerID"`
1819
}
1920

2021
type Data struct {

0 commit comments

Comments
 (0)