@@ -70,7 +70,7 @@ class SpanKwargs(TypedDict, total=False):
70
70
"""
71
71
72
72
description : str
73
- """A description of what operation is being performed within the span."""
73
+ """A description of what operation is being performed within the span. This argument is DEPRECATED. Please use the `name` parameter, instead. """
74
74
75
75
hub : Optional ["sentry_sdk.Hub" ]
76
76
"""The hub to use for this span. This argument is DEPRECATED. Please use the `scope` parameter, instead."""
@@ -97,10 +97,10 @@ class SpanKwargs(TypedDict, total=False):
97
97
Default "manual".
98
98
"""
99
99
100
- class TransactionKwargs (SpanKwargs , total = False ):
101
100
name : str
102
- """Identifier of the transaction. Will show up in the Sentry UI ."""
101
+ """A string describing what operation is being performed within the span/transaction ."""
103
102
103
+ class TransactionKwargs (SpanKwargs , total = False ):
104
104
source : str
105
105
"""
106
106
A string describing the source of the transaction name. This will be used to determine the transaction's type.
@@ -227,6 +227,10 @@ class Span:
227
227
:param op: The span's operation. A list of recommended values is available here:
228
228
https://develop.sentry.dev/sdk/performance/span-operations/
229
229
:param description: A description of what operation is being performed within the span.
230
+
231
+ .. deprecated:: 2.X.X
232
+ Please use the `name` parameter, instead.
233
+ :param name: A string describing what operation is being performed within the span.
230
234
:param hub: The hub to use for this span.
231
235
232
236
.. deprecated:: 2.0.0
@@ -261,6 +265,7 @@ class Span:
261
265
"_local_aggregator" ,
262
266
"scope" ,
263
267
"origin" ,
268
+ "name" ,
264
269
)
265
270
266
271
def __init__ (
@@ -278,6 +283,7 @@ def __init__(
278
283
start_timestamp = None , # type: Optional[Union[datetime, float]]
279
284
scope = None , # type: Optional[sentry_sdk.Scope]
280
285
origin = "manual" , # type: str
286
+ name = None , # type: Optional[str]
281
287
):
282
288
# type: (...) -> None
283
289
self .trace_id = trace_id or uuid .uuid4 ().hex
@@ -286,7 +292,7 @@ def __init__(
286
292
self .same_process_as_parent = same_process_as_parent
287
293
self .sampled = sampled
288
294
self .op = op
289
- self .description = description
295
+ self .description = name or description
290
296
self .status = status
291
297
self .hub = hub # backwards compatibility
292
298
self .scope = scope
@@ -400,6 +406,13 @@ def start_child(self, instrumenter=INSTRUMENTER.SENTRY, **kwargs):
400
406
be removed in the next major version. Going forward, it should only
401
407
be used by the SDK itself.
402
408
"""
409
+ if kwargs .get ("description" ) is not None :
410
+ warnings .warn (
411
+ "The `description` parameter is deprecated. Please use `name` instead." ,
412
+ DeprecationWarning ,
413
+ stacklevel = 2 ,
414
+ )
415
+
403
416
configuration_instrumenter = sentry_sdk .get_client ().options ["instrumenter" ]
404
417
405
418
if instrumenter != configuration_instrumenter :
@@ -750,7 +763,7 @@ class Transaction(Span):
750
763
"_baggage" ,
751
764
)
752
765
753
- def __init__ (
766
+ def __init__ ( # type: ignore[misc]
754
767
self ,
755
768
name = "" , # type: str
756
769
parent_sampled = None , # type: Optional[bool]
0 commit comments