1
0
Fork 0
mirror of synced 2024-07-08 07:46:10 +12:00

Baggage items don't work how I expected. Use tags again.

This commit is contained in:
Sam Rose 2023-12-19 17:13:15 +00:00
parent 056214c984
commit c85b8f6a96
No known key found for this signature in database

View file

@ -23,7 +23,7 @@ export default async (ctx: UserCtx, next: any) => {
if (requestAppId) { if (requestAppId) {
const span = tracer.scope().active() const span = tracer.scope().active()
span?.setBaggageItem("appId", requestAppId) span?.setTag("appId", requestAppId)
} }
// deny access to application preview // deny access to application preview
@ -79,9 +79,9 @@ export default async (ctx: UserCtx, next: any) => {
if (ctx.user) { if (ctx.user) {
const span = tracer.scope().active() const span = tracer.scope().active()
if (ctx.user._id) { if (ctx.user._id) {
span?.setBaggageItem("userId", ctx.user._id) span?.setTag("userId", ctx.user._id)
} }
span?.setBaggageItem("tenantId", ctx.user.tenantId) span?.setTag("tenantId", ctx.user.tenantId)
} }
const userId = ctx.user ? generateUserMetadataID(ctx.user._id!) : undefined const userId = ctx.user ? generateUserMetadataID(ctx.user._id!) : undefined