Skip to content

Commit

Permalink
fix otel user resolvers
Browse files Browse the repository at this point in the history
  • Loading branch information
mojotalantikite committed May 15, 2024
1 parent 16a24e0 commit 52a6aff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion services/app-api/src/resolvers/user/fetchCurrentUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {

export function fetchCurrentUserResolver(): QueryResolvers['fetchCurrentUser'] {
return async (_parent, _args, context) => {
const { user, span } = context
const { user, ctx, tracer } = context
const span = tracer?.startSpan('fetchCurrentUser', {}, ctx)
setResolverDetailsOnActiveSpan('fetchCurrentUser', user, span)
setSuccessAttributesOnActiveSpan(span)
logSuccess('fetchCurrentUser')
Expand Down
3 changes: 2 additions & 1 deletion services/app-api/src/resolvers/user/indexUsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {

export function indexUsersResolver(store: Store): QueryResolvers['indexUsers'] {
return async (_parent, _args, context) => {
const { user: currentUser, span } = context
const { user: currentUser, ctx, tracer } = context
const span = tracer?.startSpan('indexUser', {}, ctx)
setResolverDetailsOnActiveSpan('indexUsers', currentUser, span)

if (!hasAdminPermissions(currentUser)) {
Expand Down
3 changes: 2 additions & 1 deletion services/app-api/src/resolvers/user/updateCMSUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export function updateCMSUserResolver(
store: Store
): MutationResolvers['updateCMSUser'] {
return async (_parent, { input }, context) => {
const { user: currentUser, span } = context
const { user: currentUser, ctx, tracer } = context
const span = tracer?.startSpan('updateCMSUser', {}, ctx)
setResolverDetailsOnActiveSpan('updateCmsUser', currentUser, span)

// This resolver is only callable by admin users
Expand Down

0 comments on commit 52a6aff

Please sign in to comment.