public interface SamplingIntent
Information to make a sampling decision.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(long threshold, boolean adjustedCountReliable, io.opentelemetry.api.common.Attributes attributes, Function<io.opentelemetry.api.trace.TraceState,io.opentelemetry.api.trace.TraceState> traceStateUpdater)
    Returns a SamplingIntent with the given data.
    io.opentelemetry.api.common.Attributes
    Returns any attributes to add to the span to record the sampling result.
    long
    Returns the sampling threshold value.
    Function<io.opentelemetry.api.trace.TraceState,io.opentelemetry.api.trace.TraceState>
    Returns a function to apply to the tracestate of the span to possibly update it.
    boolean
    The threshold provided by the SamplingIntent can always be used to determine the sampling decision.
  • Method Details

    • create

      static SamplingIntent create(long threshold, boolean adjustedCountReliable, io.opentelemetry.api.common.Attributes attributes, Function<io.opentelemetry.api.trace.TraceState,io.opentelemetry.api.trace.TraceState> traceStateUpdater)
      Returns a SamplingIntent with the given data.
    • getThreshold

      long getThreshold()
      Returns the sampling threshold value. A lower threshold increases the likelihood of sampling.
    • isAdjustedCountReliable

      boolean isAdjustedCountReliable()
      The threshold provided by the SamplingIntent can always be used to determine the sampling decision. However, in certain situations it cannot be used to calculate the adjusted count (reciprocal of sampling probability, used by Span-to-Metrics estimation) reliably, because a non-consistent-probability sampling decision might have affected the threshold value.
      Returns:
      true if and only if the threshold can be reliably used for adjusted count calculation
    • getAttributes

      io.opentelemetry.api.common.Attributes getAttributes()
      Returns any attributes to add to the span to record the sampling result.
    • getTraceStateUpdater

      Function<io.opentelemetry.api.trace.TraceState,io.opentelemetry.api.trace.TraceState> getTraceStateUpdater()
      Returns a function to apply to the tracestate of the span to possibly update it.