Skip to content

How to create a root scope with v2 API #2267

@tylerohlsen

Description

@tylerohlsen

I'm not finding a way for my code to create a new root scope with the v2 API. With the v1 API, I was able to pass in true to the ignoreActiveScope parameter of Tracer.Instance.StartActive. That's no longer an option and not exposed on SpanCreationSettings.

If I leave Parent as null on SpanCreationSettings, then the default behavior is to inherit. And if I try to set Parent to a new empty SpanContext, I cannot because the only public constructor requires I pass a ulong spanId (not nullable) and I do not have access to the internal SpanIdGenerator.

So am I missing something? Is there another way to create a root span?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions