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, use
SamplerFunction<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 HttpSampler
NEVER_SAMPLE
Deprecated.Returns false to never start new traces for http requests.static HttpSampler
TRACE_ID
Deprecated.Ignores the request and uses thetrace ID instead
. -
Constructor Summary
Constructors Constructor Description HttpSampler()
Deprecated. -
Method Summary
Modifier and Type Method Description abstract <Req> Boolean
trySample(HttpAdapter<Req,?> adapter, Req request)
Deprecated.Returns an overriding sampling decision for a new trace.Boolean
trySample(HttpRequest request)
Deprecated.
-
Field Details
-
TRACE_ID
Deprecated.Ignores the request and uses thetrace ID instead
. -
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.
-
-
Constructor Details
-
HttpSampler
public HttpSampler()Deprecated.
-
-
Method Details
-
trySample
Deprecated.- Specified by:
trySample
in interfaceSamplerFunction<HttpRequest>
-
trySample
Deprecated.Returns an overriding sampling decision for a new trace. Return null ignore the request and use thetrace ID sampler
.
-