Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit e916ab3

Browse files
authored
update the doc to use tracer.span instead of span.span (#733)
1 parent 2ff51d7 commit e916ab3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ You can collect traces using the ``Tracer`` `context manager`_:
8080
tracer = Tracer(sampler=AlwaysOnSampler())
8181
8282
# Example for creating nested spans
83-
with tracer.span(name='span1') as span1:
83+
with tracer.span(name='span1'):
8484
do_something_to_trace()
85-
with span1.span(name='span1_child1') as span1_child1:
85+
with tracer.span(name='span1_child1'):
8686
do_something_to_trace()
87-
with span1.span(name='span1_child2') as span1_child2:
87+
with tracer.span(name='span1_child2'):
8888
do_something_to_trace()
89-
with tracer.span(name='span2') as span2:
89+
with tracer.span(name='span2'):
9090
do_something_to_trace()
9191
9292
OpenCensus will collect everything within the ``with`` statement as a single span.

0 commit comments

Comments
 (0)