Skip to content

Specify whether sample at Context for root spanΒ #3690

@ZENOTME

Description

@ZENOTME

Before opening a feature request against this repo, consider whether the feature should/could be implemented in the other OpenTelemetry client libraries. If so, please open an issue on opentelemetry-specification first.

Is your feature request related to a problem?

For now, when start a root span, the sample flag only can control by AlwaysOnSampler or AlwaysOffSampler, it can't pass a sample flag dynamically.

parent_context = opentelemetry::trace::SpanContext{false, false};

Describe the solution you'd like

Provide api like IsSample and user can pass the value by key value like is_sample

if (opentelemetry::trace::IsRootSpan(context))

Describe alternatives you've considered
Which alternative solutions or features have you considered?

Additional context
Add any other context about the feature request here.

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

    needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions