Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: clean unnecessary metrics #3475

Merged
merged 3 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions src/controllers/destination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
6 changes: 0 additions & 6 deletions src/controllers/regulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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');
Expand Down Expand Up @@ -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;
}
}
13 changes: 0 additions & 13 deletions src/util/prometheus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading