Skip to content

Commit

Permalink
Add network to mixpanel metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Dec 16, 2024
1 parent f529b1f commit c022f1b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,16 @@ func UsageMetrics(command *cobra.Command, wg *sync.WaitGroup) {
hash := sha256.Sum256([]byte(fmt.Sprintf("%s%s", usr.Username, usr.Uid)))
userID := base64.StdEncoding.EncodeToString(hash[:])

network := Flags.Network
if network == "" {
network = config.EmulatorNetwork.Name
}

_ = client.Track(userID, "cli-command", &mixpanel.Event{
IP: "0", // do not track IPs
Properties: map[string]any{
"command": command.CommandPath(),
"network": network,
"version": build.Semver(),
"os": runtime.GOOS,
},
Expand Down

0 comments on commit c022f1b

Please sign in to comment.