From 666d3fd548883d8e96ed9ec558be32c97bf60da6 Mon Sep 17 00:00:00 2001 From: andrewHEguardian <114918544+andrewHEguardian@users.noreply.github.com> Date: Fri, 22 Nov 2024 12:10:46 +0000 Subject: [PATCH] add cloudwatch metric for redirecting from ncom --- server/routes/newspaperArchive.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/routes/newspaperArchive.ts b/server/routes/newspaperArchive.ts index 5a3f11a78..0c545882d 100644 --- a/server/routes/newspaperArchive.ts +++ b/server/routes/newspaperArchive.ts @@ -5,7 +5,7 @@ import { z } from 'zod'; import { authorizationOrCookieHeader } from '../apiProxy'; import { s3ConfigPromise } from '../awsIntegration'; import { conf } from '../config'; -import { log } from '../log'; +import { log, putMetric } from '../log'; import { withIdentity } from '../middleware/identityMiddleware'; type NewspapersRequestBody = { @@ -78,6 +78,10 @@ router.get('/auth', async (req: Request, res: Response) => { archiveReturnUrlString && typeof archiveReturnUrlString === 'string' ) { + putMetric({ + loggingCode: 'REDIRECT_FROM_NEWSPAPERS_COM', + isOK: true, + }); const tpaToken = new URL(responseJson.url).searchParams.get('tpa'); const archiveReturnUrl = new URL(archiveReturnUrlString);