faust.utils.tracing

OpenTracing utilities.

faust.utils.tracing.current_span() → Optional[opentracing.span.Span][source]

Get the current span for this context (if any).

Return type

Optional[Span]

faust.utils.tracing.set_current_span(span: opentracing.span.Span) → None[source]

Set the current span for the current context.

Return type

None

faust.utils.tracing.noop_span() → opentracing.span.Span[source]

Return a span that does nothing when traced.

Return type

Span

faust.utils.tracing.finish_span(span: Optional[opentracing.span.Span], *, error: BaseException = None) → None[source]

Finish span, and optionally set error tag.

Return type

None

faust.utils.tracing.operation_name_from_fun(fun: Any) → str[source]

Generate opentracing name from function.

Return type

str

faust.utils.tracing.traced_from_parent_span(parent_span: opentracing.span.Span = None, callback: Callable = None, **extra_context: Any) → Callable[source]

Decorate function to be traced from parent span.

Return type

Callable

faust.utils.tracing.call_with_trace(span: opentracing.span.Span, fun: Callable, callback: Optional[Tuple[Callable, Tuple[Any, ...]]], *args: Any, **kwargs: Any) → Any[source]

Call function and trace it from parent span.

Return type

Any