OpenCensus and OpenTracing have merged into OpenTelemetry!


Never sampler

The Never sampler always returns a decision of False for any sampling decision

import ""

_ = trace.NeverSample()
from opencensus.trace.samplers import always_off
from opencensus.trace import tracer as tracer_module

sampler = always_off.AlwaysOffSampler()
tracer = tracer_module.Tracer(sampler=sampler)
// Samplers are potentially expensive to construct. Use one long-lived
// sampler instead of constructing one for every Span.
static opencensus::trace::NeverSampler sampler;
const root = new RootSpan(tracer);
const sampler = SamplerBuilder.getSampler(0); // Never samples when value is <= 0
const samplerShouldNotSample = sampler.shouldSample(root.traceId);


Resource URL
Go NeverSample trace.NeverSample
Python samplers trace.samplers
Java NeverSample trace.NeverSample
C++ NeverSample trace.NeverSample
Node.js TracerConfig trace.TracerConfig