nl_tokens: NOTE : This only works for counters if you re trying to extend this you should probably switch to using prom - client .
pl_tokens: function makePrometheus ( stats , defaultLabels = { } ) { const metricMapping = { processed : 'teraslice_slices_processed' , failed : 'teraslice_slices_failed' , queued : 'teraslice_slices_queued' , job_duration : '' , // this isn't really useful, omitting workers_joined : 'teraslice_workers_joined' , workers_disconnected : 'teraslice_workers_disconnected' , workers_reconnected : 'teraslice_workers_reconnected' } ; let returnString = '' ; _ . forEach ( stats . controllers , ( value , key ) => { const name = metricMapping [ key ] ; if ( name !== '' ) { returnString += ` ${ name } \n ` ; const labels = makePrometheusLabels ( defaultLabels ) ; returnString += ` ${ <mask> } ${ labels } ${ value } \n ` ; } } ) ; return returnString ; }