@@ -19,17 +19,14 @@ var telemetryBearerToken = ""
1919
2020// Event represents a telemetry event
2121type Event struct {
22- Command string `json:"command"`
23- Args []string `json:"args,omitempty"`
24- Flags map [string ]string `json:"flags,omitempty"`
25- Success bool `json:"success"`
26- Error string `json:"error,omitempty"`
27- Duration int64 `json:"duration_ms"`
28- Timestamp string `json:"timestamp"`
29- Version string `json:"version"`
30- OS string `json:"os"`
31- Arch string `json:"arch"`
32- CommandPath string `json:"command_path,omitempty"`
22+ Command string `json:"command"`
23+ Success bool `json:"success"`
24+ Error string `json:"error,omitempty"`
25+ Duration int64 `json:"duration_ms"`
26+ Timestamp string `json:"timestamp"`
27+ Version string `json:"version"`
28+ OS string `json:"os"`
29+ Arch string `json:"arch"`
3330}
3431
3532// SendEvent sends a telemetry event asynchronously
@@ -117,15 +114,12 @@ func sendEvent(event Event) error {
117114}
118115
119116// TrackCommand tracks a command execution
120- func TrackCommand (command string , args [] string , flags map [ string ] string , success bool , err error , duration time.Duration , version string ) {
117+ func TrackCommand (command string , success bool , err error , duration time.Duration , version string ) {
121118 event := Event {
122- Command : command ,
123- Args : args ,
124- Flags : flags ,
125- Success : success ,
126- Duration : duration .Milliseconds (),
127- Version : version ,
128- CommandPath : command ,
119+ Command : command ,
120+ Success : success ,
121+ Duration : duration .Milliseconds (),
122+ Version : version ,
129123 }
130124
131125 if err != nil {
@@ -136,15 +130,12 @@ func TrackCommand(command string, args []string, flags map[string]string, succes
136130}
137131
138132// TrackCommandAsync tracks a command execution asynchronously and returns a WaitGroup to wait for completion
139- func TrackCommandAsync (command string , args [] string , flags map [ string ] string , success bool , err error , duration time.Duration , version string ) * sync.WaitGroup {
133+ func TrackCommandAsync (command string , success bool , err error , duration time.Duration , version string ) * sync.WaitGroup {
140134 event := Event {
141- Command : command ,
142- Args : args ,
143- Flags : flags ,
144- Success : success ,
145- Duration : duration .Milliseconds (),
146- Version : version ,
147- CommandPath : command ,
135+ Command : command ,
136+ Success : success ,
137+ Duration : duration .Milliseconds (),
138+ Version : version ,
148139 }
149140
150141 if err != nil {
@@ -155,15 +146,12 @@ func TrackCommandAsync(command string, args []string, flags map[string]string, s
155146}
156147
157148// TrackCommandSync tracks a command execution synchronously and waits for completion
158- func TrackCommandSync (command string , args [] string , flags map [ string ] string , success bool , err error , duration time.Duration , version string ) error {
149+ func TrackCommandSync (command string , success bool , err error , duration time.Duration , version string ) error {
159150 event := Event {
160- Command : command ,
161- Args : args ,
162- Flags : flags ,
163- Success : success ,
164- Duration : duration .Milliseconds (),
165- Version : version ,
166- CommandPath : command ,
151+ Command : command ,
152+ Success : success ,
153+ Duration : duration .Milliseconds (),
154+ Version : version ,
167155 }
168156
169157 if err != nil {
0 commit comments