Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit 85674de

Browse files
authored
Constant sampler: add option to always follow the parent's decision. (#182)
Fixes #180.
1 parent b822001 commit 85674de

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/opencensus/proto/trace/v1/trace_config.proto

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,19 @@ message ProbabilitySampler {
5656
double samplingProbability = 1;
5757
}
5858

59-
// Sampler that makes a constant decision (either always "yes" or always "no")
60-
// on span sampling.
59+
// Sampler that always makes a constant decision on span sampling.
6160
message ConstantSampler {
6261

63-
// Whether spans should be always sampled, or never sampled.
64-
bool decision = 1;
62+
// How spans should be sampled:
63+
// - Always off
64+
// - Always on
65+
// - Always follow the parent Span's decision (off if no parent).
66+
enum ConstantDecision {
67+
ALWAYS_OFF = 0;
68+
ALWAYS_ON = 1;
69+
ALWAYS_PARENT = 2;
70+
}
71+
ConstantDecision decision = 1;
6572
}
6673

6774
// Sampler that tries to sample with a rate per time window.

0 commit comments

Comments
 (0)