Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: k3d client telemetry fix #1913

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions cmd/k3d/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ func runK3d(cmd *cobra.Command, args []string) error {

segClient := segment.InitClient(clusterId, clusterTypeFlag, gitProviderFlag)
defer segClient.Client.Close()
telemetry.SendEvent(segClient, telemetry.ClusterInstallStarted, "")

// Progress output
progressPrinter.AddTracker("preflight-checks", "Running preflight checks", 5)
Expand Down Expand Up @@ -462,7 +461,6 @@ func runK3d(cmd *cobra.Command, args []string) error {

log.Info().Msg("validation and kubefirst cli environment check is complete")

telemetry.SendEvent(segClient, telemetry.InitCompleted, "")
telemetry.SendEvent(segClient, telemetry.InitCompleted, "")

// Swap tokens for git protocol
Expand Down Expand Up @@ -1412,7 +1410,6 @@ func runK3d(cmd *cobra.Command, args []string) error {
}

// Mark cluster install as complete
telemetry.SendEvent(segClient, telemetry.ClusterInstallCompleted, "")
viper.Set("kubefirst-checks.cluster-install-complete", true)
viper.WriteConfig()

Expand Down
7 changes: 4 additions & 3 deletions internal/segment/segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

const (
kubefirstClient string = "api"
kubefirstClient string = "cli"
)

func InitClient(clusterId, clusterType, gitProvider string) *telemetry.SegmentClient {
Expand All @@ -28,14 +28,15 @@ func InitClient(clusterId, clusterType, gitProvider string) *telemetry.SegmentCl
ClusterType: clusterType,
DomainName: k3d.DomainName,
GitProvider: gitProvider,
InstallMethod: "kubefirst-launch",
InstallMethod: "k3d",
KubefirstClient: kubefirstClient,
KubefirstTeam: os.Getenv("KUBEFIRST_TEAM"),
KubefirstTeamInfo: os.Getenv("KUBEFIRST_TEAM_INFO"),
MachineID: machineID,
ParentClusterId: clusterId,
ErrorMessage: "",
UserId: machineID,
MetricName: telemetry.ClusterInstallStarted,
MetricName: telemetry.ClusterInstallCompleted,
},
Client: sc,
}
Expand Down
Loading