From b72ae48623304d1ceef2f4e93bce37debc042261 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Wed, 31 Jan 2024 11:57:14 -0500 Subject: [PATCH] Add otel logging back --- services/app-api/src/authn/thirdPartyAuthn.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/services/app-api/src/authn/thirdPartyAuthn.ts b/services/app-api/src/authn/thirdPartyAuthn.ts index ce52d7e2f8..577779bbca 100644 --- a/services/app-api/src/authn/thirdPartyAuthn.ts +++ b/services/app-api/src/authn/thirdPartyAuthn.ts @@ -1,22 +1,22 @@ import { ok, err } from 'neverthrow' import type { Store } from '../postgres' import { lookupUserAurora } from './cognitoAuthn' -// import { initTracer, recordException } from '../../../uploads/src/lib/otel' +import { initTracer, recordException } from '../../../uploads/src/lib/otel' export async function userFromThirdPartyAuthorizer( store: Store, userId: string ) { // // setup otel tracing - // const otelCollectorURL = process.env.REACT_APP_OTEL_COLLECTOR_URL - // if (!otelCollectorURL || otelCollectorURL === '') { - // const errMsg = - // 'Configuration Error: REACT_APP_OTEL_COLLECTOR_URL must be set' - // throw errMsg - // } + const otelCollectorURL = process.env.REACT_APP_OTEL_COLLECTOR_URL + if (!otelCollectorURL || otelCollectorURL === '') { + const errMsg = + 'Configuration Error: REACT_APP_OTEL_COLLECTOR_URL must be set' + throw errMsg + } - // const serviceName = 'third-party-authorizer' - // initTracer(serviceName, otelCollectorURL) + const serviceName = 'third-party-authorizer' + initTracer(serviceName, otelCollectorURL) try { // Lookup user from postgres @@ -33,7 +33,7 @@ export async function userFromThirdPartyAuthorizer( } catch (e) { const err = new Error('ERROR: failed to look up user in postgres') - // recordException(err, serviceName, 'lookupUser') + recordException(err, serviceName, 'lookupUser') throw err } }