7272
7373class Decision (enum .Enum ):
7474 # IsRecording() == false, span will not be recorded and all events and attributes will be dropped.
75- NOT_RECORD = 0
75+ IGNORE = 0
7676 # IsRecording() == true, but Sampled flag MUST NOT be set.
77- RECORD = 1
77+ RECORD_ONLY = 1
7878 # IsRecording() == true AND Sampled flag` MUST be set.
79- RECORD_AND_SAMPLED = 2
79+ RECORD_AND_SAMPLE = 2
8080
8181 def is_recording (self ):
82- return self in (Decision .RECORD , Decision .RECORD_AND_SAMPLED )
82+ return self in (Decision .RECORD_ONLY , Decision .RECORD_AND_SAMPLE )
8383
8484 def is_sampled (self ):
85- return self is Decision .RECORD_AND_SAMPLED
85+ return self is Decision .RECORD_AND_SAMPLE
8686
8787
8888class SamplingResult :
@@ -140,12 +140,12 @@ def should_sample(
140140 attributes : Attributes = None ,
141141 links : Sequence ["Link" ] = (),
142142 ) -> "SamplingResult" :
143- if self ._decision is Decision .NOT_RECORD :
143+ if self ._decision is Decision .IGNORE :
144144 return SamplingResult (self ._decision )
145145 return SamplingResult (self ._decision , attributes )
146146
147147 def get_description (self ) -> str :
148- if self ._decision is Decision .NOT_RECORD :
148+ if self ._decision is Decision .IGNORE :
149149 return "AlwaysOffSampler"
150150 return "AlwaysOnSampler"
151151
@@ -194,10 +194,10 @@ def should_sample(
194194 attributes : Attributes = None , # TODO
195195 links : Sequence ["Link" ] = (),
196196 ) -> "SamplingResult" :
197- decision = Decision .NOT_RECORD
197+ decision = Decision .IGNORE
198198 if trace_id & self .TRACE_ID_LIMIT < self .bound :
199- decision = Decision .RECORD_AND_SAMPLED
200- if decision is Decision .NOT_RECORD :
199+ decision = Decision .RECORD_AND_SAMPLE
200+ if decision is Decision .IGNORE :
201201 return SamplingResult (decision )
202202 return SamplingResult (decision , attributes )
203203
@@ -231,8 +231,8 @@ def should_sample(
231231 not parent_context .is_valid
232232 or not parent_context .trace_flags .sampled
233233 ):
234- return SamplingResult (Decision .NOT_RECORD )
235- return SamplingResult (Decision .RECORD_AND_SAMPLED , attributes )
234+ return SamplingResult (Decision .IGNORE )
235+ return SamplingResult (Decision .RECORD_AND_SAMPLE , attributes )
236236
237237 return self ._delegate .should_sample (
238238 parent_context = parent_context ,
@@ -246,10 +246,10 @@ def get_description(self):
246246 return "ParentBased{{{}}}" .format (self ._delegate .get_description ())
247247
248248
249- ALWAYS_OFF = StaticSampler (Decision .NOT_RECORD )
249+ ALWAYS_OFF = StaticSampler (Decision .IGNORE )
250250"""Sampler that never samples spans, regardless of the parent span's sampling decision."""
251251
252- ALWAYS_ON = StaticSampler (Decision .RECORD_AND_SAMPLED )
252+ ALWAYS_ON = StaticSampler (Decision .RECORD_AND_SAMPLE )
253253"""Sampler that always samples spans, regardless of the parent span's sampling decision."""
254254
255255DEFAULT_OFF = ParentBased (ALWAYS_OFF )
0 commit comments