pm2-prom-module icon indicating copy to clipboard operation
pm2-prom-module copied to clipboard

[feature] set custom labels for default metrics

Open mahoushoujoarale opened this issue 9 months ago • 1 comments

Hi bro, I really appreciate the work you've put into this project. For my specific use case, I need to set some custom labels like 'az', 'stage', and 'instance'. Could you advise if there's a way to implement this? collectDefaultMetrics({ register, labels: { stage: process.env.SERVICE_STAGE ?? 'unknown', version: process.env.PRODUCT_VERSION ?? 'unknown', instance_name: process.env.POD_NAME ?? process.env.HOST_NAME ?? 'unknown', az, } });

mahoushoujoarale avatar Mar 27 '25 11:03 mahoushoujoarale

Hello @mahoushoujoarale . I guess you can use https://www.npmjs.com/package/pm2-prom-module-client additional client to get metrics directly from your app.

VeXell avatar May 13 '25 07:05 VeXell