diff --git a/services/app-api/src/resolvers/attributeHelper.ts b/services/app-api/src/resolvers/attributeHelper.ts index 1d49eeac5a..79dd7214c1 100644 --- a/services/app-api/src/resolvers/attributeHelper.ts +++ b/services/app-api/src/resolvers/attributeHelper.ts @@ -8,7 +8,10 @@ export function setResolverDetailsOnActiveSpan( user: Context['user'], span: Context['span'] ): void { - if (!span) return + if (!span) { + console.info(`No span set on ${name} call`) + return + } span.setAttributes({ [SemanticAttributes.ENDUSER_ID]: user.email, [SemanticAttributes.ENDUSER_ROLE]: user.role, diff --git a/services/app-api/src/resolvers/healthPlanPackage/indexHealthPlanPackages.ts b/services/app-api/src/resolvers/healthPlanPackage/indexHealthPlanPackages.ts index fc2dbec38e..fe220799ef 100644 --- a/services/app-api/src/resolvers/healthPlanPackage/indexHealthPlanPackages.ts +++ b/services/app-api/src/resolvers/healthPlanPackage/indexHealthPlanPackages.ts @@ -53,7 +53,8 @@ export function indexHealthPlanPackagesResolver( ): QueryResolvers['indexHealthPlanPackages'] { return async (_parent, _args, context) => { const { user, span } = context - setResolverDetailsOnActiveSpan('fetchHealthPlanPackage', user, span) + + setResolverDetailsOnActiveSpan('indexHealthPlanPackages', user, span) const ratesDatabaseRefactor = await launchDarkly.getFeatureFlag( context, @@ -70,7 +71,7 @@ export function indexHealthPlanPackagesResolver( if (contractsWithHistory instanceof Error) { const errMessage = `Issue finding contracts with history by stateCode: ${user.stateCode}. Message: ${contractsWithHistory.message}` - logError('fetchHealthPlanPackage', errMessage) + logError('indexHealthPlanPackages', errMessage) setErrorAttributesOnActiveSpan(errMessage, span) if (contractsWithHistory instanceof NotFoundError) { @@ -111,7 +112,7 @@ export function indexHealthPlanPackagesResolver( if (contractsWithHistory instanceof Error) { const errMessage = `Issue finding contracts with history by submit info. Message: ${contractsWithHistory.message}` - logError('fetchHealthPlanPackage', errMessage) + logError('indexHealthPlanPackages', errMessage) setErrorAttributesOnActiveSpan(errMessage, span) if (contractsWithHistory instanceof NotFoundError) {