Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
feat: report playground user (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
lostbean authored Aug 27, 2024
1 parent 1faaa44 commit bb4b2fa
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions kardinal-cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -332,10 +333,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! 🧡")
},
Expand Down

0 comments on commit bb4b2fa

Please sign in to comment.