@@ -114,118 +114,3 @@ export async function sendMetricsEvent(
114114 logger . debug ( "Error sending metrics event" , err ) ;
115115 }
116116}
117-
118- export type CommonEventProperties = {
119- /** The version of the Wrangler client that is sending the event. */
120- wranglerVersion : string ;
121- /**
122- * The platform that the Wrangler client is running on.
123- */
124- osPlatform : string ;
125- /**
126- * The platform version that the Wrangler client is running on.
127- */
128- osVersion : string ;
129- /**
130- * The package manager that the Wrangler client is using.
131- */
132- packageManager : string | undefined ;
133- /**
134- * The version of node that the Wrangler client is running on.
135- */
136- nodeVersion : string ;
137- /**
138- * Whether this is the first time the user has used the wrangler client.
139- */
140- isFirstUsage : boolean ;
141- /**
142- * What format is the configuration file? No content from the actual configuration file is sent.
143- */
144- configFileType : "toml" | "json" | "jsonc" | "none" | "invalid" ;
145- /**
146- * Randomly generated id to tie together started, completed or errored events from one command run
147- */
148- amplitude_session_id : number ;
149- /**
150- * Tracks the order of events in a session (one command run = one session)
151- */
152- amplitude_event_id : number ;
153- /**
154- * Whether the Wrangler client is running in CI
155- */
156- isCI : boolean ;
157- /**
158- * Whether the Wrangler client is running in an interactive instance
159- */
160- isInteractive : boolean ;
161- /**
162- * A list of normalised argument names/flags that were passed in or are set by default.
163- * Excludes boolean flags set to false.
164- */
165- argsUsed : string [ ] ;
166- /**
167- * Same as argsUsed except concatenated for convenience in Amplitude
168- */
169- argsCombination : string ;
170- } ;
171-
172- /** We send a metrics event at the start and end of a command run */
173- export type Events =
174- | {
175- name : "wrangler command started" ;
176- properties : CommonEventProperties & {
177- /**
178- * The command that was used, e.g. `wrangler dev`
179- */
180- command : string ;
181- /**
182- * The args and flags that were passed in when running the command.
183- * All user-inputted string values are redacted, except for some cases where there are set options.
184- */
185- args : Record < string , unknown > ;
186- } ;
187- }
188- | {
189- name : "wrangler command completed" ;
190- properties : CommonEventProperties & {
191- /**
192- * The command that was used, e.g. `wrangler dev`
193- */
194- command : string | undefined ;
195- /**
196- * The args and flags that were passed in when running the command.
197- * All user-inputted string values are redacted, except for some cases where there are set options.
198- */
199- args : Record < string , unknown > | undefined ;
200- /**
201- * The time elapsed between the "wrangler command started" and "wrangler command completed" events
202- */
203- durationMs : number ;
204- durationMinutes : number ;
205- durationSeconds : number ;
206- } ;
207- }
208- | {
209- name : "wrangler command errored" ;
210- properties : CommonEventProperties & {
211- /**
212- * The command that was used, e.g. `wrangler dev`
213- */
214- command : string | undefined ;
215- /**
216- * The args and flags that were passed in when running the command.
217- * All user-inputted string values are redacted, except for some cases where there are set options.
218- */
219- args : Record < string , unknown > | undefined ;
220- /**
221- * The time elapsed between the "wrangler command started" and "wrangler command errored" events
222- */
223- durationMs : number ;
224- durationMinutes : number ;
225- durationSeconds : number ;
226- /**
227- * Type of error, e.g. UserError, APIError. Does not include stack trace or error message.
228- */
229- errorType : string | undefined ;
230- } ;
231- } ;
0 commit comments