Skip to content

Commit 1fe9037

Browse files
committed
more
1 parent 8e70e25 commit 1fe9037

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sentry_sdk/tracing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,12 +599,16 @@ def span_decorator(f, *a, **kw):
599599
@functools.wraps(f)
600600
async def async_wrapper(*args, **kwargs):
601601
op = kw.get("op", DEFAULT_SPAN_OP)
602-
span_name = name or f.__name__
602+
span_name = kw.get("name", f.__name__)
603+
attributes = kw.get("attributes", {})
603604

604605
with sentry_sdk.start_span(
605606
op=op,
606607
name=span_name,
607608
) as span:
609+
for key, value in attributes.items():
610+
span.set_attribute(key, value)
611+
608612
set_input_attributes(span, as_type, args, kwargs)
609613

610614
# run wrapped function

0 commit comments

Comments
 (0)