@@ -7,6 +7,7 @@ import { ErrorHandler } from "./errors";
77import { Options } from "../../options" ;
88import { needProjectId } from "../../projectUtils" ;
99import { saveEtags } from "../../extensions/etags" ;
10+ import { trackGA4 } from "../../track" ;
1011
1112export async function release ( context : Context , options : Options , payload : Payload ) {
1213 const projectId = needProjectId ( options ) ;
@@ -45,6 +46,20 @@ export async function release(context: Context, options: Options, payload: Paylo
4546 deploymentQueue . close ( ) ;
4647
4748 await deploymentPromise ;
49+ // extensionsStartTime should always be populated, but if not, fall back to something that won't break us.
50+ const duration = context . extensionsStartTime ? Date . now ( ) - context . extensionsStartTime : 1 ;
51+ await trackGA4 (
52+ "extensions_deploy" ,
53+ {
54+ extension_instance_created : payload . instancesToCreate ?. length ?? 0 ,
55+ extension_instance_updated : payload . instancesToUpdate ?. length ?? 0 ,
56+ extension_instance_configured : payload . instancesToConfigure ?. length ?? 0 ,
57+ extension_instance_deleted : payload . instancesToDelete ?. length ?? 0 ,
58+ errors : errorHandler . errors . length ?? 0 ,
59+ interactive : options . nonInteractive ? "false" : "true" ,
60+ } ,
61+ duration
62+ ) ;
4863
4964 // After deployment, write the latest etags to RC so we can detect out of band changes in the next deploy.
5065 const newHave = await planner . have ( projectId ) ;
0 commit comments