Important Changes
- feat: Ensure
withActiveSpan
is exported everywhere (#10877)
You can use the withActiveSpan
method to ensure a certain span is the active span in a given callback. This can be
used to create a span as a child of a specific span with the startSpan
API methods:
const parentSpan = Sentry.startInactiveSpan({ name: 'parent' });
if (parentSpan) {
withActiveSpan(parentSpan, () => {
// This will be a direct child of parentSpan
const childSpan = Sentry.startInactiveSpan({ name: 'child' });
});
}