Skip to content

Commit

Permalink
Add span.is_recording check
Browse files Browse the repository at this point in the history
  • Loading branch information
bschoenmaeckers committed Jan 30, 2023
1 parent fd14f5c commit 5b70387
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ def _wrap_connect_internal(func, module, args, kwargs):
with tracer.start_as_current_span(
"connect", kind=trace.SpanKind.CLIENT
) as span:
attrs, _ = _get_attributes_from_url(module.url)
span.set_attributes(attrs)
if span.is_recording():
attrs, _ = _get_attributes_from_url(module.url)
span.set_attributes(attrs)
return func(*args, **kwargs)

return _wrap_connect_internal
Expand Down

0 comments on commit 5b70387

Please sign in to comment.