From 85674de74598a61991045c1ac36af551029b89c8 Mon Sep 17 00:00:00 2001 From: easy Date: Fri, 1 Mar 2019 14:22:02 +1100 Subject: [PATCH] Constant sampler: add option to always follow the parent's decision. (#182) Fixes #180. --- src/opencensus/proto/trace/v1/trace_config.proto | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/opencensus/proto/trace/v1/trace_config.proto b/src/opencensus/proto/trace/v1/trace_config.proto index 07645de..0f9b5f3 100644 --- a/src/opencensus/proto/trace/v1/trace_config.proto +++ b/src/opencensus/proto/trace/v1/trace_config.proto @@ -56,12 +56,19 @@ message ProbabilitySampler { double samplingProbability = 1; } -// Sampler that makes a constant decision (either always "yes" or always "no") -// on span sampling. +// Sampler that always makes a constant decision on span sampling. message ConstantSampler { - // Whether spans should be always sampled, or never sampled. - bool decision = 1; + // How spans should be sampled: + // - Always off + // - Always on + // - Always follow the parent Span's decision (off if no parent). + enum ConstantDecision { + ALWAYS_OFF = 0; + ALWAYS_ON = 1; + ALWAYS_PARENT = 2; + } + ConstantDecision decision = 1; } // Sampler that tries to sample with a rate per time window.