GitHub

API reference for Span.

A span made by a Tracer. Once it has ended, end, attribute, event and add_links do nothing; an ended span can still be read and used as a parent.

Attributes

AttributeTypeDescription
namestr
span_idstr
trace_idstr
parentAnySpan | None
annotationsContext
statusSpanStatus
attributesMapping[str, object]
linksSequence[SpanLink]
sampledbool
kindSpanKind

Functions

end

end(end_time, exit) -> None
ParameterTypeDescription
end_timeint
exitExit[object, object]
def end(self, end_time: int, exit: Exit[object, object], /) -> None: ...

attribute

attribute(key, value) -> None
ParameterTypeDescription
keystr
valueobject
def attribute(self, key: str, value: object, /) -> None: ...

event

event(name, start_time, attributes=None) -> None
ParameterTypeDescription
namestr
start_timeint
attributesMapping[str, object] | None = None
def event(
    self, name: str, start_time: int, attributes: Mapping[str, object] | None = None, /
) -> None: ...
add_links(links) -> None
ParameterTypeDescription
linksSequence[SpanLink]
def add_links(self, links: Sequence[SpanLink], /) -> None: ...