Skip to content

Commit 3a3357c

Browse files
committed
Better var naming
1 parent 981da49 commit 3a3357c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sentry_sdk/integrations/opentelemetry/sampler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ def get_parent_sampled(parent_context, trace_id):
4646
return None
4747

4848

49-
def dropped_result(span_context, attributes, sample_rate=None):
49+
def dropped_result(parent_span_context, attributes, sample_rate=None):
5050
# type: (SpanContext, Attributes, Optional[float]) -> SamplingResult
5151
# these will only be added the first time in a root span sampling decision
52-
trace_state = span_context.trace_state
52+
trace_state = parent_span_context.trace_state
5353

5454
if TRACESTATE_SAMPLED_KEY not in trace_state:
5555
trace_state = trace_state.add(TRACESTATE_SAMPLED_KEY, "false")
5656

5757
if sample_rate and TRACESTATE_SAMPLE_RATE_KEY not in trace_state:
5858
trace_state = trace_state.add(TRACESTATE_SAMPLE_RATE_KEY, str(sample_rate))
5959

60-
is_root_span = not (span_context.is_valid and not span_context.is_remote)
60+
is_root_span = not (parent_span_context.is_valid and not parent_span_context.is_remote)
6161
if is_root_span:
6262
# Tell Sentry why we dropped the transaction/root-span
6363
client = sentry_sdk.get_client()

tests/test_monitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_monitor_unhealthy(sentry_init):
5555
assert monitor.downsample_factor == (i + 1 if i < 10 else 10)
5656

5757

58-
def test_transaction_uses_downsampled_rate(
58+
def test_transaction_uses_downsample_rate(
5959
sentry_init, capture_envelopes, capture_record_lost_event_calls, monkeypatch
6060
):
6161
sentry_init(

0 commit comments

Comments
 (0)