OpenCensus and OpenTracing have merged into OpenTelemetry!


Always sampler

The Always sampler always returns a decision of True for any sampling decision

Code samples

import ""

_ = trace.AlwaysSample()
from opencensus.trace.samplers import always_on
from opencensus.trace import tracer as tracer_module

# This is the default sampler
sampler = always_on.AlwaysOnSampler()
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::AlwaysSampler sampler;
const root = new RootSpan(tracer);
const sampler = SamplerBuilder.getSampler(1); // Always samples when value is >= 1
const samplerShouldSample = sampler.shouldSample(root.traceId);


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