Skip to content

Commit 5319e53

Browse files
committed
feat: start a root span with spanOptions.parent = null (open-telemetry#889)
* feat: start a root span with spanOptions.parent = null * chore: lint * chore: add return type for readability
1 parent 41e0d74 commit 5319e53

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

api/src/trace/SpanOptions.ts

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ export interface SpanOptions {
4444
* A parent `SpanContext` (or `Span`, for convenience) that the newly-started
4545
* span will be the child of. This overrides the parent span extracted from
4646
* the currently active context.
47+
*
48+
* A null value here should prevent the SDK from extracting a parent from
49+
* the current context, forcing the new span to be a root span.
4750
*/
4851
parent?: Span | SpanContext | null;
4952

0 commit comments

Comments
 (0)