Skip to content

Commit ba0a8f9

Browse files
authored
Merge pull request #950 from chrono/patch-2
fix documentation for current_root_span
2 parents 468effd + f1b20af commit ba0a8f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ddtrace/tracer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,8 @@ def current_root_span(self):
387387
# get the root span
388388
root_span = tracer.current_root_span()
389389
# set the host just once on the root span
390-
root_span.set_tag('host', '127.0.0.1')
390+
if root_span:
391+
root_span.set_tag('host', '127.0.0.1')
391392
"""
392393
ctx = self.get_call_context()
393394
if ctx:

0 commit comments

Comments
 (0)