Skip to content

Commit e6ca5a2

Browse files
authored
Remove usages of deprecated description and replace by name in start_span() calls. (getsentry#3525)
Replace the deprecated `description` parameter in all calls to `start_span()` and `start_child` and replace it with the new `name` parameter.
1 parent b1b16b0 commit e6ca5a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+98
-100
lines changed

sentry_sdk/ai/monitoring.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def sync_wrapped(*args, **kwargs):
3333
curr_pipeline = _ai_pipeline_name.get()
3434
op = span_kwargs.get("op", "ai.run" if curr_pipeline else "ai.pipeline")
3535

36-
with start_span(description=description, op=op, **span_kwargs) as span:
36+
with start_span(name=description, op=op, **span_kwargs) as span:
3737
for k, v in kwargs.pop("sentry_tags", {}).items():
3838
span.set_tag(k, v)
3939
for k, v in kwargs.pop("sentry_data", {}).items():
@@ -62,7 +62,7 @@ async def async_wrapped(*args, **kwargs):
6262
curr_pipeline = _ai_pipeline_name.get()
6363
op = span_kwargs.get("op", "ai.run" if curr_pipeline else "ai.pipeline")
6464

65-
with start_span(description=description, op=op, **span_kwargs) as span:
65+
with start_span(name=description, op=op, **span_kwargs) as span:
6666
for k, v in kwargs.pop("sentry_tags", {}).items():
6767
span.set_tag(k, v)
6868
for k, v in kwargs.pop("sentry_data", {}).items():

sentry_sdk/integrations/aiohttp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ async def on_request_start(session, trace_config_ctx, params):
205205

206206
span = sentry_sdk.start_span(
207207
op=OP.HTTP_CLIENT,
208-
description="%s %s"
208+
name="%s %s"
209209
% (method, parsed_url.url if parsed_url else SENSITIVE_DATA_SUBSTITUTE),
210210
origin=AioHttpIntegration.origin,
211211
)

sentry_sdk/integrations/anthropic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def _sentry_patched_create(*args, **kwargs):
9494

9595
span = sentry_sdk.start_span(
9696
op=OP.ANTHROPIC_MESSAGES_CREATE,
97-
description="Anthropic messages create",
97+
name="Anthropic messages create",
9898
origin=AnthropicIntegration.origin,
9999
)
100100
span.__enter__()

sentry_sdk/integrations/arq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ async def _sentry_enqueue_job(self, function, *args, **kwargs):
7979
return await old_enqueue_job(self, function, *args, **kwargs)
8080

8181
with sentry_sdk.start_span(
82-
op=OP.QUEUE_SUBMIT_ARQ, description=function, origin=ArqIntegration.origin
82+
op=OP.QUEUE_SUBMIT_ARQ, name=function, origin=ArqIntegration.origin
8383
):
8484
return await old_enqueue_job(self, function, *args, **kwargs)
8585

sentry_sdk/integrations/asyncio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def _coro_creating_hub_and_span():
4646
with sentry_sdk.isolation_scope():
4747
with sentry_sdk.start_span(
4848
op=OP.FUNCTION,
49-
description=get_name(coro),
49+
name=get_name(coro),
5050
origin=AsyncioIntegration.origin,
5151
):
5252
try:

sentry_sdk/integrations/asyncpg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ async def _inner(*args: Any, **kwargs: Any) -> T:
165165

166166
with sentry_sdk.start_span(
167167
op=OP.DB,
168-
description="connect",
168+
name="connect",
169169
origin=AsyncPGIntegration.origin,
170170
) as span:
171171
span.set_data(SPANDATA.DB_SYSTEM, "postgresql")

sentry_sdk/integrations/boto3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _sentry_request_created(service_id, request, operation_name, **kwargs):
6969
description = "aws.%s.%s" % (service_id, operation_name)
7070
span = sentry_sdk.start_span(
7171
op=OP.HTTP_CLIENT,
72-
description=description,
72+
name=description,
7373
origin=Boto3Integration.origin,
7474
)
7575

@@ -107,7 +107,7 @@ def _sentry_after_call(context, parsed, **kwargs):
107107

108108
streaming_span = span.start_child(
109109
op=OP.HTTP_CLIENT_STREAM,
110-
description=span.description,
110+
name=span.description,
111111
origin=Boto3Integration.origin,
112112
)
113113

sentry_sdk/integrations/celery/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def apply_async(*args, **kwargs):
274274
span_mgr = (
275275
sentry_sdk.start_span(
276276
op=OP.QUEUE_SUBMIT_CELERY,
277-
description=task_name,
277+
name=task_name,
278278
origin=CeleryIntegration.origin,
279279
)
280280
if not task_started_from_beat
@@ -374,7 +374,7 @@ def _inner(*args, **kwargs):
374374
try:
375375
with sentry_sdk.start_span(
376376
op=OP.QUEUE_PROCESS,
377-
description=task.name,
377+
name=task.name,
378378
origin=CeleryIntegration.origin,
379379
) as span:
380380
_set_messaging_destination_name(task, span)
@@ -503,7 +503,7 @@ def sentry_publish(self, *args, **kwargs):
503503

504504
with sentry_sdk.start_span(
505505
op=OP.QUEUE_PUBLISH,
506-
description=task_name,
506+
name=task_name,
507507
origin=CeleryIntegration.origin,
508508
) as span:
509509
if task_id is not None:

sentry_sdk/integrations/clickhouse_driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def _inner(*args: P.args, **kwargs: P.kwargs) -> T:
8383

8484
span = sentry_sdk.start_span(
8585
op=OP.DB,
86-
description=query,
86+
name=query,
8787
origin=ClickhouseDriverIntegration.origin,
8888
)
8989

sentry_sdk/integrations/cohere.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def new_chat(*args, **kwargs):
142142

143143
span = sentry_sdk.start_span(
144144
op=consts.OP.COHERE_CHAT_COMPLETIONS_CREATE,
145-
description="cohere.client.Chat",
145+
name="cohere.client.Chat",
146146
origin=CohereIntegration.origin,
147147
)
148148
span.__enter__()
@@ -227,7 +227,7 @@ def new_embed(*args, **kwargs):
227227
# type: (*Any, **Any) -> Any
228228
with sentry_sdk.start_span(
229229
op=consts.OP.COHERE_EMBEDDINGS_CREATE,
230-
description="Cohere Embedding Creation",
230+
name="Cohere Embedding Creation",
231231
origin=CohereIntegration.origin,
232232
) as span:
233233
integration = sentry_sdk.get_client().get_integration(CohereIntegration)

0 commit comments

Comments
 (0)