![]() |
Abstract base class for tracers.
Methods
receive_rpc
receive_rpc() -> Optional[T]
Unpack parent_span_yield
from the receiving end of an RPC.
span
@abc.abstractmethod
span( scope: str, sub_scope: str, nonce: int, parent_span_yield: Optional[T], fn_args: Optional[tuple[Any, ...]], fn_kwargs: Optional[dict[str, Any]], trace_opts: dict[str, Any] ) -> Generator[T, TraceResult, None]
Create a new tracing span.
Args | |
---|---|
scope
|
String name of the scope, often the class name. |
sub_scope
|
String name of the sub-scope, often the function name. |
nonce
|
Number used to correlate tracing messages relating to the same function invocation. |
parent_span_yield
|
The value yielded by the most recently started (and not
exited) call to span on this TracingProvider on the current
asyncio.Task or thread (when running outside of an async context).
|
fn_args
|
When this tracing provider wraps a function, this will be a tuple containing all of the non-keyword function arguments. |
fn_kwargs
|
When this tracing provider wraps a function, this will be a dict containing all of the keyword function arguments. |
trace_opts
|
User-provided options to the span constructor.
TracingProvider s should ignore unknown options.
|
Returns | |
---|---|
A Generator which will be immediately started and run up until it
yields for the first time. The value yielded by this Generator
will be passed on to nested calls to span . When the spanned code ends,
a TraceResult will be passed back through the yield .
|
wrap_rpc
wrap_rpc(
parent_span_yield: Optional[T]
) -> contextlib.AbstractContextManager[None]
Wrap an RPC call so that it can carry over the parent_span_yield
.