Skip to content

Commit

Permalink
improve request span
Browse files Browse the repository at this point in the history
  • Loading branch information
patroza committed Nov 15, 2023
1 parent 69b7e8a commit 3d318d2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/infra/_src/api/setupRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,19 @@ const withRequestSpan = <R, E, A>(f: Effect<R, E, A>) =>
f
.withSpan("request", {
attributes: {
requestId: ctx.id,
requestName: ctx.name,
"request.id": ctx.id,
"request.name": ctx.name,
"request.locale": ctx.locale,
"request.namespace": ctx.namespace,
...ctx.userProfile?.sub
? {
requestUserSub: ctx
"request.user.sub": ctx
.userProfile
.sub
.sub,
"request.user.roles": "roles" in ctx
.userProfile
? ctx.userProfile.roles
: undefined
}
: {}
}
Expand Down

0 comments on commit 3d318d2

Please sign in to comment.