Skip to content

Commit 51342fb

Browse files
committed
add sample_rate, sample_rate to spans
1 parent c5fcb3e commit 51342fb

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

sentry_sdk/scope.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,8 @@ def start_streamed_span(
12241224
parent_span_id=propagation_context.parent_span_id,
12251225
parent_sampled=propagation_context.parent_sampled,
12261226
baggage=propagation_context.baggage,
1227+
sample_rand=sample_rand,
1228+
sample_rate=sample_rate,
12271229
)
12281230

12291231
# This is a child span; take propagation context from the parent span

sentry_sdk/traces.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ class StreamedSpan:
224224
"_scope",
225225
"_previous_span_on_scope",
226226
"_baggage",
227+
"_sample_rand",
228+
"_sample_rate",
227229
)
228230

229231
def __init__(
@@ -238,6 +240,8 @@ def __init__(
238240
parent_span_id: "Optional[str]" = None,
239241
parent_sampled: "Optional[bool]" = None,
240242
baggage: "Optional[Baggage]" = None,
243+
sample_rate: "Optional[float]" = None,
244+
sample_rand: "Optional[float]" = None,
241245
):
242246
self._name: str = name
243247
self._active: bool = active
@@ -254,6 +258,8 @@ def __init__(
254258
self._parent_span_id = parent_span_id
255259
self._parent_sampled = parent_sampled
256260
self._baggage = baggage
261+
self._sample_rand = sample_rand
262+
self._sample_rate = sample_rate
257263

258264
self._start_timestamp = datetime.now(timezone.utc)
259265
self._timestamp: "Optional[datetime]" = None

0 commit comments

Comments
 (0)