Skip to content

Commit

Permalink
Add otel logging back
Browse files Browse the repository at this point in the history
  • Loading branch information
pearl-truss committed Jan 31, 2024
1 parent 882cb6b commit b72ae48
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions services/app-api/src/authn/thirdPartyAuthn.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
}
}

0 comments on commit b72ae48

Please sign in to comment.