Skip to content

Add continueTrace function #9011

@lforst

Description

@lforst

Problem Statement

It would be cool for any unsupported frameworks and even for the SDK internally in higher order SDKs to have a function that continues a trace from a sentry-trace and baggage value and starts a new transaction.

Solution Brainstorm

Function signature:

interface continueTrace<V> {
  (traceInformation: { sentryTrace: string, baggage: string }, (tracedTransaction: Transaction) => V): V
}

Example:

export function handler(req, res, next) {
  return continueTrace({
    sentryTrace: req.headers["sentry-trace"],
    baggage: req.headers["baggage"]
  }, (transaction) => {
    transaction.seTag('foo', 'bar');
    return next()
  });
}

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions