Class AlwaysSampleSampler


  • @Immutable
    final class AlwaysSampleSampler
    extends Sampler
    Sampler that always makes a "yes" decision on Span sampling.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDescription()
      Returns the description of this Sampler.
      boolean shouldSample​(SpanContext parentContext, java.lang.Boolean hasRemoteParent, TraceId traceId, SpanId spanId, java.lang.String name, java.util.List<Span> parentLinks)
      Called during Span creation to make a sampling decision.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AlwaysSampleSampler

        AlwaysSampleSampler()
    • Method Detail

      • shouldSample

        public boolean shouldSample​(@Nullable
                                    SpanContext parentContext,
                                    @Nullable
                                    java.lang.Boolean hasRemoteParent,
                                    TraceId traceId,
                                    SpanId spanId,
                                    java.lang.String name,
                                    java.util.List<Span> parentLinks)
        Description copied from class: Sampler
        Called during Span creation to make a sampling decision.
        Specified by:
        shouldSample in class Sampler
        Parameters:
        parentContext - the parent span's SpanContext. null if this is a root span.
        hasRemoteParent - true if the parent Span is remote. null if this is a root span.
        traceId - the TraceId for the new Span. This will be identical to that in the parentContext, unless this is a root span.
        spanId - the SpanId for the new Span.
        name - the name of the new Span.
        parentLinks - the parentLinks associated with the new Span.
        Returns:
        true if the Span is sampled.
      • getDescription

        public java.lang.String getDescription()
        Description copied from class: Sampler
        Returns the description of this Sampler. This may be displayed on debug pages or in the logs.

        Example: "ProbabilitySampler{0.000100}"

        Specified by:
        getDescription in class Sampler
        Returns:
        the description of this Sampler.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object