From bbc492a1e71c33f5d233d811f69e60f70427fccc Mon Sep 17 00:00:00 2001 From: lostbean Date: Mon, 26 Aug 2024 18:54:13 -0300 Subject: [PATCH] report playground user --- kardinal-cli/cmd/root.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/kardinal-cli/cmd/root.go b/kardinal-cli/cmd/root.go index dc9f7cec..04a51424 100644 --- a/kardinal-cli/cmd/root.go +++ b/kardinal-cli/cmd/root.go @@ -3,14 +3,15 @@ package cmd import ( "context" "fmt" - "gopkg.in/yaml.v3" - "kardinal.cli/consts" - "kardinal.cli/multi_os_cmd_executor" "log" "os" "path" "strings" + "gopkg.in/yaml.v3" + "kardinal.cli/consts" + "kardinal.cli/multi_os_cmd_executor" + "github.com/kurtosis-tech/stacktrace" "github.com/segmentio/analytics-go/v3" "github.com/sirupsen/logrus" @@ -327,10 +328,15 @@ var reportInstall = &cobra.Command{ analyticsClient := analytics.New("IMYNcUACcPpcIJuS6ChHpMd4z4ZpvVFq") defer analyticsClient.Close() + props := analytics.NewProperties() + if username, exists := os.LookupEnv("KARDINAL_PLAYGROUND_USERNAME"); exists { + props.Set("playground_username", username) + } + analyticsClient.Enqueue(analytics.Track{ Event: "install_cli", UserId: tenantUuid.String(), - Properties: analytics.NewProperties(), + Properties: props, }) log.Println("Thank you for helping us improve Kardinal! 🧡") },