This repository has been archived by the owner on May 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 161
Fix some v2.0.0 docs #82
Merged
+270
−192
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ def active_span(self): | |
Tracer.scope_manager.active.span, and None will be returned if | ||
Scope.span is None. | ||
|
||
:return: returns the active Span. | ||
:return: the active Span. | ||
""" | ||
scope = self._scope_manager.active | ||
return None if scope is None else scope.span | ||
|
@@ -72,7 +72,7 @@ def start_active_span(self, | |
finish_on_close=True): | ||
"""Returns a newly started and activated `Scope`. | ||
|
||
The returned `Scope` supports with-statement contexts. For example: | ||
The returned `Scope` supports with-statement contexts. For example:: | ||
|
||
with tracer.start_active_span('...') as scope: | ||
scope.span.set_tag('http.method', 'GET') | ||
|
@@ -81,7 +81,7 @@ def start_active_span(self, | |
# the with statement. | ||
|
||
It's also possible to not finish the `Span` when the `Scope` context | ||
expires: | ||
expires:: | ||
|
||
with tracer.start_active_span('...', | ||
finish_on_close=False) as scope: | ||
|
@@ -108,7 +108,7 @@ def start_active_span(self, | |
:param finish_on_close: whether span should automatically be finished | ||
when `Scope#close()` is called. | ||
|
||
:return: a `Scope`, already registered via the `ScopeManager`. | ||
:return: a `Scope`, already registered via the `ScopeManager`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Double backquotes maybe? |
||
""" | ||
return self._noop_scope | ||
|
||
|
@@ -127,7 +127,7 @@ def start_span(self, | |
tracer.start_span('...') | ||
|
||
|
||
Starting a child Span (see also start_child_span()):: | ||
Starting a child Span (see also `start_child_span()`):: | ||
|
||
tracer.start_span( | ||
'...', | ||
|
@@ -157,7 +157,7 @@ def start_span(self, | |
:param ignore_active_span: an explicit flag that ignores the current | ||
active `Scope` and creates a root `Span`. | ||
|
||
:return: Returns an already-started Span instance. | ||
:return: an already-started Span instance. | ||
""" | ||
return self._noop_span | ||
|
||
|
@@ -192,9 +192,9 @@ def extract(self, format, carrier): | |
Implementations MUST raise opentracing.UnsupportedFormatException if | ||
`format` is unknown or disallowed. | ||
|
||
Implementations may raise opentracing.InvalidCarrierException, | ||
opentracing.SpanContextCorruptedException, or implementation-specific | ||
errors if there are problems with `carrier`. | ||
Implementations may raise :meth:`opentracing.InvalidCarrierException`, | ||
:meth:`opentracing.SpanContextCorruptedException`, or | ||
implementation-specific errors if there are problems with `carrier`. | ||
|
||
:param format: a python object instance that represents a given | ||
carrier format. `format` may be of any type, and `format` equality | ||
|
@@ -224,13 +224,13 @@ class ReferenceType(object): | |
class Reference(namedtuple('Reference', ['type', 'referenced_context'])): | ||
"""A Reference pairs a reference type with a referenced SpanContext. | ||
|
||
References are used by Tracer.start_span() to describe the relationships | ||
between Spans. | ||
References are used by :meth:`Tracer.start_span()` to describe the | ||
relationships between Spans. | ||
|
||
Tracer implementations must ignore references where referenced_context is | ||
None. This behavior allows for simpler code when an inbound RPC request | ||
contains no tracing information and as a result tracer.extract() returns | ||
None:: | ||
contains no tracing information and as a result :meth:`Tracer.extract()` | ||
returns None:: | ||
|
||
parent_ref = tracer.extract(opentracing.HTTP_HEADERS, request.headers) | ||
span = tracer.start_span( | ||
|
@@ -273,7 +273,7 @@ def follows_from(referenced_context=None): | |
def start_child_span(parent_span, operation_name, tags=None, start_time=None): | ||
"""A shorthand method that starts a child_of span for a given parent span. | ||
|
||
Equivalent to calling | ||
Equivalent to calling:: | ||
|
||
parent_span.tracer().start_span( | ||
operation_name, | ||
|
@@ -290,7 +290,7 @@ def start_child_span(parent_span, operation_name, tags=None, start_time=None): | |
:param start_time: an explicit Span start time as a unix timestamp per | ||
time.time(). | ||
|
||
:return: Returns an already-started Span instance. | ||
:return: an already-started Span instance. | ||
""" | ||
return parent_span.tracer.start_span( | ||
operation_name=operation_name, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backquote(s) here maybe, too?