Skip to content

Commit f2f96ce

Browse files
committed
Fixed passing down Sentry metadata over GCP metadata
- we should prefer Sentry metadata over GCP metadata because when we're doing distributed tracing, we want to see the full request in context of the parent instead of creating a new trace
1 parent c5f6408 commit f2f96ce

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/app.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,8 @@ app.use(async (ctx, next) => {
352352
return Sentry.continueTrace(
353353
{
354354
sentryTrace:
355-
traceId && spanId
356-
? `${traceId}-${spanId}-1`
357-
: ctx.req.header('sentry-trace'),
355+
ctx.req.header('sentry-trace') ||
356+
(traceId && spanId ? `${traceId}-${spanId}-1` : undefined),
358357
baggage: ctx.req.header('baggage'),
359358
},
360359
() => {

0 commit comments

Comments
 (0)