Skip to content

Support Sampling for Long-Duration Span and Erroneous Span #12279

@pepeshore

Description

@pepeshore

Is your feature request related to a problem? Please describe.

100% sampling rate is not suitable for production environments because of high overhead,but non-100% sampling may lead to the loss of certain important spans,such as long-Duration span and erroneous span. I try to provide a custom io.opentelemetry.sdk.trace.SpanProcessor which will hold the spans associated with the same traceId util LocalRootSpan is ended. But I found that when isRecording(samplingDecision) is false, a io.opentelemetry.api.trace.PropagatedSpan is returned instead of io.opentelemetry.sdk.trace.SdkSpan which lost a lot of important information

Describe the solution you'd like

Two solution

  1. Return a SDKSpan even if isRecording(samplingDecision) is false, by this, I can give a custom io.opentelemetry.sdk.trace.SpanProcessor to implement Sampling for Long-Duration Span and Erroneous Span
  2. if sampling for long-duration span、erroneous span or other span with specified feature is a common need,can the agent give a native support

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions