OpenCensus is being archived! Read the blog post to learn more

Never

Never sampler

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

import "go.opencensus.io/trace"

_ = trace.NeverSample()
Samplers.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);

Reference

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