Skip to content

Commit 1684350

Browse files
committed
[installation-telemetry] Expose Customer ID field in telemetry
1 parent 3225597 commit 1684350

File tree

6 files changed

+10
-0
lines changed

6 files changed

+10
-0
lines changed

components/gitpod-protocol/src/installation-admin-protocol.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export interface TelemetryData {
2929
totalWorkspaces: number;
3030
totalInstances: number;
3131
licenseType: string;
32+
customerID?: string;
3233
}
3334

3435
export namespace InstallationAdmin {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type Data struct {
2323
TotalWorkspaces int64 `json:"totalWorkspaces"`
2424
TotalInstances int64 `json:"totalInstances"`
2525
LicenseType string `json:"licenseType"`
26+
CustomerID string `json:"customerID,omitempty"`
2627
}
2728

2829
type InstallationAdmin struct {

components/licensor/ee/pkg/licensor/licensor.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ type LicensePayload struct {
5353

5454
// Seats == 0 means there's no seat limit
5555
Seats int `json:"seats"`
56+
57+
// CustomerID is used to identify installations in installation analytics
58+
CustomerID string `json:"customerID"`
5659
}
5760

5861
type licensePayload struct {

components/licensor/ee/pkg/licensor/replicated.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ func newReplicatedEvaluator(client *http.Client) (res *Evaluator) {
118118

119119
case "seats":
120120
lic.Seats = int(i.Value.(float64))
121+
122+
case "customerId":
123+
lic.CustomerID = i.Value.(string)
121124
}
122125
}
123126

components/licensor/typescript/ee/src/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export interface LicensePayload {
2929
level: LicenseLevel
3030
validUntil: string
3131
seats: number
32+
customerID: string
3233
}
3334

3435
export enum LicenseSubscriptionLevel {

components/server/src/installation-admin/telemetry-data-provider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export class InstallationAdminTelemetryDataProvider {
2727
totalWorkspaces: await this.workspaceDb.getWorkspaceCount(),
2828
totalInstances: await this.workspaceDb.getInstanceCount(),
2929
licenseType: this.licenseEvaluator.getLicenseData().type,
30+
customerID: this.licenseEvaluator.getLicenseData().payload.customerID,
3031
} as TelemetryData;
3132
return data;
3233
} finally {

0 commit comments

Comments
 (0)