From bef7003a00b5972de533b03239d89c5c81df5606 Mon Sep 17 00:00:00 2001 From: Mohsin Zaidi <2236875+smrz2001@users.noreply.github.com> Date: Wed, 12 Jun 2024 19:29:04 -0400 Subject: [PATCH] feat: add metric for status requests found in db --- src/controllers/request-controller.ts | 1 + src/settings.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/controllers/request-controller.ts b/src/controllers/request-controller.ts index dc89bba8..25bb3919 100644 --- a/src/controllers/request-controller.ts +++ b/src/controllers/request-controller.ts @@ -80,6 +80,7 @@ export class RequestController { try { const response = await this.requestService.getStatusForCid(cid) + Metrics.count(METRIC_NAMES.CTRL_REQUEST_FOUND, 1, { source: parseOrigin(req) }) return res.status(StatusCodes.OK).json(response) } catch (err: any) { if (err instanceof RequestDoesNotExistError) { diff --git a/src/settings.ts b/src/settings.ts index 616dae50..acb22c6d 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -87,4 +87,5 @@ export enum METRIC_NAMES { CTRL_INVALID_REQUEST = 'ctrl_invalid_request', CTRL_ERROR_CREATING_REQUEST = 'ctrl_error_creating_request', CTRL_REQUEST_NOT_FOUND = 'ctrl_request_not_found', + CTRL_REQUEST_FOUND = 'ctrl_request_found', }