Context Tracer¶
-
class
opencensus.trace.tracers.context_tracer.
ContextTracer
(exporter=None, span_context=None)[source]¶ Bases:
opencensus.trace.tracers.base.Tracer
The interface for tracing a request context.
- Parameters
span_context (
SpanContext
) -- SpanContext encapsulates the current context within the request's trace.
-
add_attribute_to_current_span
(attribute_key, attribute_value)[source]¶ Add attribute to current span.
- Parameters
attribute_key (str) -- Attribute key.
:type attribute_value:str :param attribute_value: Attribute value.
-
end_span
(*args, **kwargs)[source]¶ End a span. Update the span_id in SpanContext to the current span's parent span id; Update the current span.
-
get_span_datas
(span)[source]¶ Extracts a list of SpanData tuples from a span
- Return type
list of opencensus.trace.span_data.SpanData
:return list of SpanData tuples