diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 748de16657..68717c5c14 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -131,7 +131,6 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh ### Removed -- 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. @@ -157,11 +156,15 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh - `profiles_sample_rate` and `profiler_mode` were removed from options available via `_experiments`. Use the top-level `profiles_sample_rate` and `profiler_mode` options instead. - `Transport.capture_event` has been removed. Use `Transport.capture_envelope` instead. - Function transports are no longer supported. Subclass the `Transport` instead. +- `start_transaction` (`start_span`) no longer takes the following arguments: + - `trace_id`, `baggage`: use `continue_trace` for propagation from headers or environment variables + - `same_process_as_parent` + - `span_id` + - `parent_span_id`: you can supply a `parent_span` instead - Setting `Scope.transaction` directly is no longer supported. Use `Scope.set_transaction_name()` instead. - Passing a list or `None` for `failed_request_status_codes` in the Starlette integration is no longer supported. Pass a set of integers instead. - The `span` argument of `Scope.trace_propagation_meta` is no longer supported. - Setting `Scope.user` directly is no longer supported. Use `Scope.set_user()` instead. -- `start_transaction` (`start_span`) no longer takes a `baggage` argument. Use the `continue_trace()` context manager instead to propagate baggage. - Dropped support for Django versions below 2.0. - Dropped support for trytond versions below 5.0. - Dropped support for Falcon versions below 3.0. diff --git a/sentry_sdk/tracing.py b/sentry_sdk/tracing.py index 312aef14c1..5a06d704ee 100644 --- a/sentry_sdk/tracing.py +++ b/sentry_sdk/tracing.py @@ -239,14 +239,9 @@ def __init__( only_if_parent=False, # type: bool parent_span=None, # type: Optional[Span] otel_span=None, # type: Optional[OtelSpan] - **_, # type: dict[str, object] ): # type: (...) -> None """ - For backwards compatibility with old the old Span interface, this class - accepts arbitrary keyword arguments, in addition to the ones explicitly - listed in the signature. These additional arguments are ignored. - If otel_span is passed explicitly, just acts as a proxy. If only_if_parent is True, just return an INVALID_SPAN @@ -284,6 +279,8 @@ def __init__( attributes[SentrySpanAttribute.OP] = op if source is not None: attributes[SentrySpanAttribute.SOURCE] = source + if description is not None: + attributes[SentrySpanAttribute.DESCRIPTION] = description if sampled is not None: attributes[SentrySpanAttribute.CUSTOM_SAMPLED] = sampled @@ -543,7 +540,7 @@ def timestamp(self): def start_child(self, **kwargs): # type: (**Any) -> Span - return Span(sampled=self.sampled, parent_span=self, **kwargs) + return Span(parent_span=self, **kwargs) def iter_headers(self): # type: () -> Iterator[Tuple[str, str]]