Skip to content

Commit 2983854

Browse files
sentrivananellaG
andauthored
Drop propagate_traces (#4206)
Drop the deprecated `propagate_traces` `init` option in POTel. Important: The Celery integration also has an option called `propagate_traces` -- this should remain unchanged. --------- Co-authored-by: nellaG <seirios0107@gmail.com>
1 parent aaebe61 commit 2983854

File tree

4 files changed

+1
-24
lines changed

4 files changed

+1
-24
lines changed

MIGRATION_GUIDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
134134
- Spans no longer have a `description`. Use `name` instead.
135135
- Dropped support for Python 3.6.
136136
- The `enable_tracing` `init` option has been removed. Configure `traces_sample_rate` directly.
137+
- The `propagate_traces` `init` option has been removed. Use `trace_propagation_targets` instead.
137138
- The `custom_sampling_context` parameter of `start_transaction` has been removed. Use `attributes` instead to set key-value pairs of data that should be accessible in the traces sampler. Note that span attributes need to conform to the [OpenTelemetry specification](https://opentelemetry.io/docs/concepts/signals/traces/#attributes), meaning only certain types can be set as values.
138139
- The PyMongo integration no longer sets tags. The data is still accessible via span attributes.
139140
- The PyMongo integration doesn't set `operation_ids` anymore. The individual IDs (`operation_id`, `request_id`, `session_id`) are now accessible as separate span attributes.

sentry_sdk/consts.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,6 @@ def __init__(
511511
debug=None, # type: Optional[bool]
512512
attach_stacktrace=False, # type: bool
513513
ca_certs=None, # type: Optional[str]
514-
propagate_traces=True, # type: bool
515514
traces_sample_rate=None, # type: Optional[float]
516515
traces_sampler=None, # type: Optional[TracesSampler]
517516
profiles_sample_rate=None, # type: Optional[float]
@@ -915,8 +914,6 @@ def __init__(
915914
916915
:param profile_session_sample_rate:
917916
918-
:param propagate_traces:
919-
920917
:param auto_session_tracking:
921918
922919
:param spotlight:

sentry_sdk/scope.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -610,13 +610,6 @@ def iter_trace_propagation_headers(self, *args, **kwargs):
610610
If no span is given, the trace data is taken from the scope.
611611
"""
612612
client = self.get_client()
613-
if not client.options.get("propagate_traces"):
614-
warnings.warn(
615-
"The `propagate_traces` parameter is deprecated. Please use `trace_propagation_targets` instead.",
616-
DeprecationWarning,
617-
stacklevel=2,
618-
)
619-
return
620613

621614
span = kwargs.pop("span", None)
622615
span = span or self.span

tests/tracing/test_integration_tests.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,6 @@ def test_continue_trace(sentry_init, capture_envelopes, sample_rate): # noqa:N8
117117
assert message_payload["message"] == "hello"
118118

119119

120-
@pytest.mark.parametrize("sample_rate", [0.0, 1.0])
121-
def test_propagate_traces_deprecation_warning(sentry_init, sample_rate):
122-
sentry_init(traces_sample_rate=sample_rate, propagate_traces=False)
123-
124-
with start_span(name="hi"):
125-
with start_span() as old_span:
126-
with pytest.warns(DeprecationWarning):
127-
dict(
128-
sentry_sdk.get_current_scope().iter_trace_propagation_headers(
129-
old_span
130-
)
131-
)
132-
133-
134120
@pytest.mark.parametrize("sample_rate", [0.5, 1.0])
135121
def test_dynamic_sampling_head_sdk_creates_dsc(
136122
sentry_init,

0 commit comments

Comments
 (0)