Top Description Inners Methods
io.micrometer.tracing

public Interface SamplerFunction<T>

Known Direct Implementers
io.micrometer.tracing.SamplerFunction.Constants
Type Parameters
<T>
type of the input, for example a request or method
Imports
io.micrometer.common.lang.Nullable

This API was heavily influenced by Brave. Parts of its documentation were taken directly from Brave.

Decides whether to start a new trace based on request properties such as an HTTP path.

Authors
OpenZipkin Brave Authors, Marcin Grzejszczak
Since
1.0.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Method Summary

Modifier and TypeMethod and Description
public static <
type of the input, for example a request or method
T
>
SamplerFunction<T>

Returns:

always sampling sampler function
alwaysSample
()

Always sampling SamplerFunction.

public static <
type of the input, for example a request or method
T
>
SamplerFunction<T>

Returns:

decision deferring sampler function
deferDecision
()

Always deferring SamplerFunction.

public static <
type of the input, for example a request or method
T
>
SamplerFunction<T>

Returns:

never sampling sampler function
neverSample
()

Never sampling SamplerFunction.

public Boolean

Returns:

true to sample a new trace or false to deny. null defers the decision.
trySample
(T
parameter to evaluate for a sampling decision. null input results in a null result
arg
)

Returns an overriding sampling decision for a new trace.

Method Detail

alwaysSampleback to summary
public static <T> SamplerFunction<T> alwaysSample()

Always sampling SamplerFunction.

Parameters
<T>
type of the input, for example a request or method
Returns:SamplerFunction<T>

always sampling sampler function

Annotations
@SuppressWarnings:unchecked
deferDecisionback to summary
public static <T> SamplerFunction<T> deferDecision()

Always deferring SamplerFunction.

Parameters
<T>
type of the input, for example a request or method
Returns:SamplerFunction<T>

decision deferring sampler function

Annotations
@SuppressWarnings:unchecked
neverSampleback to summary
public static <T> SamplerFunction<T> neverSample()

Never sampling SamplerFunction.

Parameters
<T>
type of the input, for example a request or method
Returns:SamplerFunction<T>

never sampling sampler function

Annotations
@SuppressWarnings:unchecked
trySampleback to summary
public Boolean trySample(T arg)

Returns an overriding sampling decision for a new trace.

Parameters
arg:T

parameter to evaluate for a sampling decision. null input results in a null result

Returns:Boolean

true to sample a new trace or false to deny. null defers the decision.

Annotations
@Nullable
io.micrometer.tracing back to summary

public sealed Enum SamplerFunction.Constants

extends Enum<SamplerFunction.Constants>
implements SamplerFunction<Object>
Class Inheritance
All Implemented Interfaces
io.micrometer.tracing.SamplerFunction

Constant SamplerFunctions.

Field Summary

Modifier and TypeField and Description
public static final SamplerFunction.Constants
ALWAYS_SAMPLE

Will always sample this trace.

public static final SamplerFunction.Constants
DEFER_DECISION

Always defers sampling decision.

public static final SamplerFunction.Constants
NEVER_SAMPLE

Will never sample this trace.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static SamplerFunction.Constants
public static SamplerFunction.Constants[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ALWAYS_SAMPLEback to summary
public static final SamplerFunction.Constants ALWAYS_SAMPLE

Will always sample this trace.

DEFER_DECISIONback to summary
public static final SamplerFunction.Constants DEFER_DECISION

Always defers sampling decision.

NEVER_SAMPLEback to summary
public static final SamplerFunction.Constants NEVER_SAMPLE

Will never sample this trace.

Constructor Detail

Constantsback to summary
private Constants()

Method Detail

valueOfback to summary
public static SamplerFunction.Constants valueOf(String name)
valuesback to summary
public static SamplerFunction.Constants[] values()