From 20020aff1743db14527842bf62e6f09f10e9ed34 Mon Sep 17 00:00:00 2001 From: Sankeerth Date: Wed, 19 Jun 2024 11:30:49 +0530 Subject: [PATCH] chore: clean unnecessary metrics (#3475) --- src/controllers/destination.ts | 25 ------------------------- src/controllers/regulation.ts | 6 ------ src/util/prometheus.js | 13 ------------- 3 files changed, 44 deletions(-) diff --git a/src/controllers/destination.ts b/src/controllers/destination.ts index 998cab67bb..1b9d19c5af 100644 --- a/src/controllers/destination.ts +++ b/src/controllers/destination.ts @@ -19,7 +19,6 @@ import logger from '../logger'; export class DestinationController { public static async destinationTransformAtProcessor(ctx: Context) { - const startTime = new Date(); logger.debug('Native(Process-Transform):: Requst to transformer::', ctx.request.body); let resplist: ProcessorTransformationResponse[]; const requestMetadata = MiscService.getRequestMetadata(ctx); @@ -71,22 +70,10 @@ export class DestinationController { version, ...metaTags, }); - stats.timing('dest_transform_request_latency', startTime, { - destination, - feature: tags.FEATURES.PROCESSOR, - version, - ...metaTags, - }); - stats.increment('dest_transform_requests', { - destination, - version, - ...metaTags, - }); return ctx; } public static async destinationTransformAtRouter(ctx: Context) { - const startTime = new Date(); logger.debug('Native(Router-Transform):: Requst to transformer::', ctx.request.body); const requestMetadata = MiscService.getRequestMetadata(ctx); const routerRequest = ctx.request.body as RouterTransformationRequest; @@ -145,18 +132,11 @@ export class DestinationController { version: 'v0', ...metaTags, }); - stats.timing('dest_transform_request_latency', startTime, { - destination, - version: 'v0', - feature: tags.FEATURES.ROUTER, - ...metaTags, - }); return ctx; } public static batchProcess(ctx: Context) { logger.debug('Native(Process-Transform-Batch):: Requst to transformer::', ctx.request.body); - const startTime = new Date(); const requestMetadata = MiscService.getRequestMetadata(ctx); const routerRequest = ctx.request.body as RouterTransformationRequest; const destination = routerRequest.destType; @@ -187,11 +167,6 @@ export class DestinationController { ctx.body = [errResp]; } ControllerUtility.postProcess(ctx); - stats.timing('dest_transform_request_latency', startTime, { - destination, - feature: tags.FEATURES.BATCH, - version: 'v0', - }); return ctx; } } diff --git a/src/controllers/regulation.ts b/src/controllers/regulation.ts index 2d40c518f4..ecb55ff7a3 100644 --- a/src/controllers/regulation.ts +++ b/src/controllers/regulation.ts @@ -2,7 +2,6 @@ import { Context } from 'koa'; import { ServiceSelector } from '../helpers/serviceSelector'; import { DestinationPostTransformationService } from '../services/destination/postTransformation'; import { UserDeletionRequest, UserDeletionResponse } from '../types'; -import stats from '../util/stats'; import tags from '../v0/util/tags'; // eslint-disable-next-line @typescript-eslint/no-unused-vars import { CatchErr } from '../util/types'; @@ -11,7 +10,6 @@ import logger from '../logger'; export class RegulationController { public static async deleteUsers(ctx: Context) { logger.debug('Native(Process-Transform):: Requst to transformer::', ctx.request.body); - const startTime = new Date(); let rudderDestInfo: any; try { const rudderDestInfoHeader = ctx.get('x-rudder-dest-info'); @@ -47,10 +45,6 @@ export class RegulationController { ctx.body = [{ error, statusCode: 500 }] as UserDeletionResponse[]; // TODO: responses array length is always 1. Is that okay? ctx.status = 500; } - stats.timing('dest_transform_request_latency', startTime, { - feature: tags.FEATURES.USER_DELETION, - version: 'v0', - }); return ctx; } } diff --git a/src/util/prometheus.js b/src/util/prometheus.js index 5b7fe692b4..fe9a2af107 100644 --- a/src/util/prometheus.js +++ b/src/util/prometheus.js @@ -721,19 +721,6 @@ class Prometheus { type: 'histogram', labelNames: ['feature', 'implementation', 'destType'], }, - { - name: 'dest_transform_request_latency', - help: 'dest_transform_request_latency', - type: 'histogram', - labelNames: [ - 'destination', - 'version', - 'sourceType', - 'destinationType', - 'k8_namespace', - 'feature', - ], - }, { name: 'user_transform_request_latency', help: 'user_transform_request_latency',