Skip to content

How to retrieve parent span instance from active span objectΒ #6065

@Apokalypt

Description

@Apokalypt

Hi

I would like to know if there is a way to retrieve the parent span instance of the current active span ?

Context

I'm using opentelemetry with winston to save logs and traces in an app insights. We have implemented a sampling strategy in which we are keeping only 1% of logs/traces (it's more complicated but let's simplify like this)
In case of service crash I would like to be able to force the sampling of the active span AND the parent spans. For that, I am catching unhandledRejection and uncaughtException to set the traceFlags to 1 on the active span. But I never found how to apply the same rule over the parent spans. Is there any way to perform this kind of things ?

Tip: React with πŸ‘ to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions