prom: set category for reqCounter

pull/468/head
undefined 2 years ago
parent 57796912e4
commit d02934f766

@ -25,6 +25,7 @@ const coll = db.collection('dataReport');
class DataReportHandler extends Handler {
noCheckPermView = true;
category = '#center';
@post('installId', Types.String)
@post('payload', Types.String)

@ -26,7 +26,7 @@ export function createRegistry(ctx: Context) {
const reqCounter = createMetric(Counter, 'hydro_reqcount', 'reqcount', {
labelNames: ['domainId'],
});
ctx.on('handler/create', (h) => reqCounter.inc({ domainId: h.args.domainId }));
ctx.on('handler/create', (h) => reqCounter.inc({ domainId: (h as any).category || h.args.domainId }));
const judgeCounter = createMetric(Counter, 'hydro_judgecount', 'judgecount');
ctx.on('record/judge', () => judgeCounter.inc());

Loading…
Cancel
Save