Package brave.http
Class HttpSampler
- java.lang.Object
-
- brave.http.HttpSampler
-
- All Implemented Interfaces:
SamplerFunction<HttpRequest>
- Direct Known Subclasses:
HttpRuleSampler
@Deprecated public abstract class HttpSampler extends Object implements SamplerFunction<HttpRequest>
Deprecated.Since 5.8, useSamplerFunction<HttpRequest>.Decides whether to start a new trace based on http request properties such as path.Ex. Here's a sampler that only traces api requests
{@code httpTracingBuilder.serverSampler(new HttpSampler() {- See Also:
HttpRuleSampler,SamplerFunction
-
-
Field Summary
Fields Modifier and Type Field Description static HttpSamplerNEVER_SAMPLEDeprecated.Returns false to never start new traces for http requests.static HttpSamplerTRACE_IDDeprecated.Ignores the request and uses thetrace ID instead.
-
Constructor Summary
Constructors Constructor Description HttpSampler()Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract <Req> BooleantrySample(HttpAdapter<Req,?> adapter, Req request)Deprecated.Returns an overriding sampling decision for a new trace.BooleantrySample(HttpRequest request)Deprecated.
-
-
-
Field Detail
-
TRACE_ID
public static final HttpSampler TRACE_ID
Deprecated.Ignores the request and uses thetrace ID instead.
-
NEVER_SAMPLE
public static final HttpSampler NEVER_SAMPLE
Deprecated.Returns false to never start new traces for http requests. For example, you may wish to only capture traces if they originated from an inbound server request. Such a policy would filter out client requests made during bootstrap.
-
-
Method Detail
-
trySample
@Nullable public Boolean trySample(HttpRequest request)
Deprecated.- Specified by:
trySamplein interfaceSamplerFunction<HttpRequest>
-
trySample
@Nullable public abstract <Req> Boolean trySample(HttpAdapter<Req,?> adapter, Req request)
Deprecated.Returns an overriding sampling decision for a new trace. Return null ignore the request and use thetrace ID sampler.
-
-