8000 Drop `propagate_traces` by sentrivana · Pull Request #4206 · getsentry/sentry-python · GitHub
[go: up one dir, main page]

Skip to content

Drop propagate_traces #4206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
- Spans no longer have a `description`. Use `name` instead.
- Dropped support for Python 3.6.
- The `enable_tracing` `init` option has been removed. Configure `traces_sample_rate` directly.
- The `propagate_traces` `init` option has been removed. Use `trace_propagation_targets` instead.
- 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.
- The PyMongo integration no longer sets tags. The data is still accessible via span attributes.
- 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.
Expand Down
3 changes: 0 additions & 3 deletions sentry_sdk/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,6 @@ def __init__(
debug=None, # type: Optional[bool]
attach_stacktrace=False, # type: bool
ca_certs=None, # type: Optional[str]
propagate_traces=True, # type: bool
traces_sample_rate=None, # type: Optional[float]
traces_sampler=None, # type: Optional[TracesSampler]
profiles_sample_rate=None, # type: Optional[float]
Expand Down Expand Up @@ -915,8 +914,6 @@ def __init__(

:param profile_session_sample_rate:

:param propagate_traces:

:param auto_session_tracking:

:param spotlight:
Expand Down
7 changes: 0 additions & 7 deletions sentry_sdk/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,13 +610,6 @@ def iter_trace_propagation_headers(self, *args, **kwargs):
If no span is given, the trace data is taken from the scope.
"""
client = self.get_client()
if not client.options.get("propagate_traces"):
warnings.warn(
"The `propagate_traces` parameter is deprecated. Please use `trace_propagation_targets` instead.",
DeprecationWarning,
stacklevel=2,
)
return

span = kwargs.pop("span", None)
span = span or self.span
Expand Down
14 changes: 0 additions & 14 deletions tests/tracing/test_integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,6 @@ def test_continue_trace(sentry_init, capture_envelopes, sample_rate): # noqa:N8
assert message_payload["message"] == "hello"


@pytest.mark.parametrize("sample_rate", [0.0, 1.0])
def test_propagate_traces_deprecation_warning(sentry_init, sample_rate):
sentry_init(traces_sample_rate=sample_rate, propagate_traces=False)

with start_span(name="hi"):
with start_span() as old_span:
with pytest.warns(DeprecationWarning):
dict(
sentry_sdk.get_current_scope().iter_trace_propagation_headers(
old_span
)
)


@pytest.mark.parametrize("sample_rate", [0.5, 1.0])
def test_dynamic_sampling_head_sdk_creates_dsc(
sentry_init,
Expand Down
Loading
0