diff --git a/internal/segment/segment.go b/internal/segment/segment.go index d4b1808e3..e13bab385 100644 --- a/internal/segment/segment.go +++ b/internal/segment/segment.go @@ -7,38 +7,32 @@ import ( "github.com/kubefirst/kubefirst/configs" "github.com/kubefirst/metrics-client/pkg/telemetry" "github.com/kubefirst/runtime/pkg/k3d" - - "github.com/segmentio/analytics-go" ) const ( kubefirstClient string = "api" ) -func InitClient(clusterId, clusterType, gitProvider string) *telemetry.SegmentClient { +func InitClient(clusterId, clusterType, gitProvider string) telemetry.TelemetryEvent { machineID, _ := machineid.ID() - sc := analytics.New(telemetry.SegmentIOWriteKey) - c := telemetry.SegmentClient{ - TelemetryEvent: telemetry.TelemetryEvent{ - CliVersion: configs.K1Version, - CloudProvider: k3d.CloudProvider, - ClusterID: clusterId, - ClusterType: clusterType, - DomainName: k3d.DomainName, - GitProvider: gitProvider, - InstallMethod: "kubefirst-launch", - KubefirstClient: kubefirstClient, - KubefirstTeam: os.Getenv("KUBEFIRST_TEAM"), - KubefirstTeamInfo: os.Getenv("KUBEFIRST_TEAM_INFO"), - MachineID: machineID, - ErrorMessage: "", - UserId: machineID, - MetricName: telemetry.ClusterInstallStarted, - }, - Client: sc, + c := telemetry.TelemetryEvent{ + CliVersion: configs.K1Version, + CloudProvider: k3d.CloudProvider, + ClusterID: clusterId, + ClusterType: clusterType, + DomainName: k3d.DomainName, + GitProvider: gitProvider, + InstallMethod: "kubefirst-launch", + KubefirstClient: kubefirstClient, + KubefirstTeam: os.Getenv("KUBEFIRST_TEAM"), + KubefirstTeamInfo: os.Getenv("KUBEFIRST_TEAM_INFO"), + MachineID: machineID, + ErrorMessage: "", + MetricName: telemetry.ClusterInstallStarted, + UserId: machineID, } - return &c + return c }