Skip to content

Why do I need to keep track of the lifetime of the scope/span objects myself? #2249

Open
@Falmarri

Description

@Falmarri

I'm trying to instrument some code that's used in a library that has very specific code flow. Keeping track of the spans and scopes myself is very tricky because I can't pass the spans/scopes. I have to store them in some locally managed storage.

In other tracing libraries (not c++), I've always just been able to do the equivalent of tracer->StartSpan(), and then some time later tracer->CurrentSpan()->End() or whatever. Is there advice on managing scopes if their lifetime is complicated? The only ways I see it working are global state, or polluting the types of all my functions to pass the scope around.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalegood first issueGood for newcomershelp wantedGood for taking. Extra help will be provided by maintainerstriage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions