Skip to content

Commit bad71c7

Browse files
committed
Deprecate more stuff
1 parent 2a853a4 commit bad71c7

File tree

2 files changed

+4
-47
lines changed

2 files changed

+4
-47
lines changed

MIGRATION_GUIDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
157157
- `Transport.capture_event` has been removed. Use `Transport.capture_envelope` instead.
158158
- Function transports are no longer supported. Subclass the `Transport` instead.
159159
- `start_transaction` (`start_span`) no longer takes an explicit `sampled` argument.
160+
- `start_transaction` (`start_span`) no longer takes an explicit `description` argument. Use `name` instead.
161+
- `start_transaction` (`start_span`) no longer takes an explicit `trace_id` or `span_id` argument. Use `continue_trace` for propagation from headers or environment variables.
162+
160163

161164
### Deprecated
162165

sentry_sdk/tracing.py

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -51,36 +51,12 @@
5151
from sentry_sdk.tracing_utils import Baggage
5252

5353
class SpanKwargs(TypedDict, total=False):
54-
trace_id: str
55-
"""
56-
The trace ID of the root span. If this new span is to be the root span,
57-
omit this parameter, and a new trace ID will be generated.
58-
"""
59-
60-
span_id: str
61-
"""The span ID of this span. If omitted, a new span ID will be generated."""
62-
63-
parent_span_id: str
64-
"""The span ID of the parent span, if applicable."""
65-
66-
same_process_as_parent: bool
67-
"""Whether this span is in the same process as the parent span."""
68-
69-
sampled: bool
70-
"""
71-
Whether the span should be sampled. Overrides the default sampling decision
72-
for this span when provided.
73-
"""
74-
7554
op: str
7655
"""
7756
The span's operation. A list of recommended values is available here:
7857
https://develop.sentry.dev/sdk/performance/span-operations/
7958
"""
8059

81-
description: str
82-
"""A description of what operation is being performed within the span. This argument is DEPRECATED. Please use the `name` parameter, instead."""
83-
8460
status: str
8561
"""The span's status. Possible values are listed at https://develop.sentry.dev/sdk/event-payloads/span/"""
8662

@@ -114,12 +90,6 @@ class TransactionKwargs(SpanKwargs, total=False):
11490
Default "custom".
11591
"""
11692

117-
parent_sampled: bool
118-
"""Whether the parent transaction was sampled. If True this transaction will be kept, if False it will be discarded."""
119-
120-
baggage: "Baggage"
121-
"""The W3C baggage header value. (see https://www.w3.org/TR/baggage/)"""
122-
12393
ProfileContext = TypedDict(
12494
"ProfileContext",
12595
{
@@ -307,7 +277,6 @@ def __init__(
307277
self,
308278
*,
309279
op=None, # type: Optional[str]
310-
description=None, # type: Optional[str]
311280
status=None, # type: Optional[str]
312281
start_timestamp=None, # type: Optional[Union[datetime, float]]
313282
origin=None, # type: Optional[str]
@@ -349,7 +318,7 @@ def __init__(
349318
# OTel timestamps have nanosecond precision
350319
start_timestamp = convert_to_otel_timestamp(start_timestamp)
351320

352-
span_name = name or description or op or DEFAULT_SPAN_NAME
321+
span_name = name or op or DEFAULT_SPAN_NAME
353322

354323
# Prepopulate some attrs so that they're accessible in traces_sampler
355324
attributes = attributes or {}
@@ -372,7 +341,6 @@ def __init__(
372341
)
373342

374343
self.origin = origin or DEFAULT_SPAN_ORIGIN
375-
self.description = description
376344
self.name = span_name
377345

378346
if status is not None:
@@ -431,20 +399,6 @@ def __exit__(self, ty, value, tb):
431399
context.detach(self._ctx_token)
432400
del self._ctx_token
433401

434-
@property
435-
def description(self):
436-
# type: () -> Optional[str]
437-
from sentry_sdk.integrations.opentelemetry.consts import SentrySpanAttribute
438-
439-
return self.get_attribute(SentrySpanAttribute.DESCRIPTION)
440-
441-
@description.setter
442-
def description(self, value):
443-
# type: (Optional[str]) -> None
444-
from sentry_sdk.integrations.opentelemetry.consts import SentrySpanAttribute
445-
446-
self.set_attribute(SentrySpanAttribute.DESCRIPTION, value)
447-
448402
@property
449403
def origin(self):
450404
# type: () -> Optional[str]

0 commit comments

Comments
 (0)