Skip to content

Commit 76963e5

Browse files
committed
Corecting trace coniguration from example to properly continue trace manually
1 parent c15115b commit 76963e5

File tree

1 file changed

+5
-5
lines changed
  • docs/platforms/javascript/common/tracing/span-metrics

1 file changed

+5
-5
lines changed

docs/platforms/javascript/common/tracing/span-metrics/examples.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,17 +319,17 @@ app.post('/api/upload', async (req: Request<{}, {}, UploadRequest>, res: Respons
319319
// Async media processing (runs in background via setImmediate)
320320
export async function processMedia(job: ProcessingJob): Promise<void> {
321321
// Continue trace from producer using stored trace headers
322-
Sentry.continueTrace(
322+
await Sentry.continueTrace(
323323
{ sentryTrace: job.sentryTrace, baggage: job.sentryBaggage },
324-
() => {
324+
async () => {
325325
// Parent span for the consumer transaction
326-
Sentry.startSpan(
326+
await Sentry.startSpan(
327327
{
328328
name: 'media_processing_consumer',
329329
},
330-
(parentSpan) => {
330+
async (parentSpan) => {
331331
// Consumer span: Process the queued job
332-
Sentry.startSpan(
332+
await Sentry.startSpan(
333333
{
334334
op: 'queue.process',
335335
name: 'queue_consumer',

0 commit comments

Comments
 (0)