import { CeloEnvArgv } from 'src/lib/env-utils' ; import { deleteMetric , getMetrics } from 'src/lib/monitoring' ; export const command = 'delete' ; export const describe = 'delete metrics' ; interface DeleteMetricsArgv extends CeloEnvArgv { prefix : string ; } export const builder = ( argv ) => { argv . option ( 'prefix' , { required : true , type : 'string' , alias : 'p' , } ) ; } ; export const handler = async ( argv ) => { const metrics = await getMetrics ( argv . prefix ) ; await Promise . all ( metrics . map ( ( metric ) => deleteMetric ( metric . name ) ) ) ; } ;