prom: set category for reqCounter

This commit is contained in:
undefined committed 2022-11-27 01:05:07 +08:00
1 parent 57796912e4
commit d02934f766
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -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)
+1 -1
View File
@@ -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());