Skip to content

Commit

Permalink
Re-added Sentry.continueTrace to pass down tracing context
Browse files Browse the repository at this point in the history
- we need this so we can pass tracing context throug the isolated scope
  • Loading branch information
daniellockyer committed Nov 18, 2024
1 parent 25c5e9a commit 85d0022
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,19 +400,27 @@ app.use(async (ctx, next) => {
return event;
});

return Sentry.startSpan(
return Sentry.continueTrace(
{
op: 'http.server',
name: `${ctx.req.method} ${ctx.req.path}`,
attributes: {
...extra,
'service.name': 'activitypub',
},
sentryTrace: ctx.req.header('sentry-trace'),
baggage: ctx.req.header('baggage'),
},
() => {
return withContext(extra, () => {
return next();
});
return Sentry.startSpan(
{
op: 'http.server',
name: `${ctx.req.method} ${ctx.req.path}`,
attributes: {
...extra,
'service.name': 'activitypub',
},
},
() => {
return withContext(extra, () => {
return next();
});
},
);
},
);
});
Expand Down

0 comments on commit 85d0022

Please sign in to comment.