From 54a4ffbb96a6eb71a5e5e6b82978107981c71993 Mon Sep 17 00:00:00 2001 From: Abhimanyu Babbar Date: Tue, 12 Mar 2024 16:17:12 +0530 Subject: [PATCH] readd the size of batch request for tracking plan validation --- src/services/trackingPlan.ts | 5 +++++ src/util/prometheus.js | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/services/trackingPlan.ts b/src/services/trackingPlan.ts index 9562da3730..036b76c73d 100644 --- a/src/services/trackingPlan.ts +++ b/src/services/trackingPlan.ts @@ -71,6 +71,11 @@ export class TrackingPlanservice { respList.push(eventValidationResponse); } + stats.histogram('tp_batch_size', requestSize, { + ...metaTags, + ...tpTags, + }); + // capture overall function latency // with metadata tags stats.histogram('tp_batch_validation_latency', (Date.now() - startTime) / 1000, { diff --git a/src/util/prometheus.js b/src/util/prometheus.js index d406fadee0..b502681987 100644 --- a/src/util/prometheus.js +++ b/src/util/prometheus.js @@ -590,10 +590,16 @@ class Prometheus { labelNames: ['method', 'route', 'code'], }, { - name: 'tp_request_size', - help: 'tp_request_size', + name: 'tp_batch_size', + help: 'Size of batch of events for tracking plan validation', type: 'histogram', - labelNames: ['sourceType', 'destinationType', 'k8_namespace'], + labelNames: [ + 'sourceType', + 'destinationType', + 'k8_namespace', + 'workspaceId', + 'trackingPlanId', + ], }, { name: 'tp_event_validation_latency',