@@ -97,6 +97,13 @@ def get_parent_sample_rand(parent_context, trace_id):
9797
9898def dropped_result (parent_span_context , attributes , sample_rate = None , sample_rand = None ):
9999 # type: (SpanContext, Attributes, Optional[float], Optional[Decimal]) -> SamplingResult
100+ """
101+ React to a span getting unsampled and return a DROP SamplingResult.
102+
103+ Update the trace_state with the effective sampled, sample_rate and sample_rand,
104+ record that we dropped the event for client report purposes, and return
105+ an OTel SamplingResult with Decision.DROP.
106+ """
100107 # these will only be added the first time in a root span sampling decision
101108 # if sample_rate or sample_rand is provided, they'll be updated in trace state
102109 trace_state = parent_span_context .trace_state
@@ -138,6 +145,12 @@ def dropped_result(parent_span_context, attributes, sample_rate=None, sample_ran
138145
139146def sampled_result (span_context , attributes , sample_rate = None , sample_rand = None ):
140147 # type: (SpanContext, Attributes, Optional[float], Optional[Decimal]) -> SamplingResult
148+ """
149+ React to a span being sampled and return a sampled SamplingResult.
150+
151+ Update the trace_state with the effective sampled, sample_rate and sample_rand,
152+ and return an OTel SamplingResult with Decision.RECORD_AND_SAMPLE.
153+ """
141154 # these will only be added the first time in a root span sampling decision
142155 # if sample_rate or sample_rand is provided, they'll be updated in trace state
143156 trace_state = span_context .trace_state
0 commit comments