Skip to content

[FEATURE]: Start a new span with no parent #6077

@rhyek

Description

@rhyek

Package Name

No response

Package Version(s)

5.57.1

Describe the feature you'd like

I have a background worker function polling for data every x seconds inside a while loop and I want the spans created within each iteration to have a clean slate. This is to avoid having 1 parent trace with thousands+ spans for every iteration.

I see tracer.trace and tracer.startSpan both accept a childOf option. TypeScript complains if I try to set this to null, and I believe tracer.trace will inherit the parent span by default. Not sure about startSpan.

What is the best practice here?

Is your feature request related to a problem?

No response

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions