Span
class Span
This plain PHP class represents a single timed event within a Trace. Spans can be nested and form a trace tree. Often, a trace contains a root span that describes the end-to-end latency of an operation and, optionally, one or more subspans for its suboperations. Spans do not need to be contiguous. There may be gaps between spans in a trace.
Traits
Methods
Attach a single attribute to this object.
Instantiate a new Span instance.
Retrieve the start time for this span.
Retrieve the end time for this span.
Retrieve the ID of this span.
Retrieve the ID of this span's parent if it exists.
Retrieve the name of this span.
Add time events to this span.
Return the time events for this span.
Add links to this span.
Set the status for this span.
Retrieve the stackTrace at the moment this span was created
Whether or not this span is in the same process as its parent.
Details
in AttributeTrait at line 32
addAttributes(array $attributes)
Attach attributes to this object.
in AttributeTrait at line 45
addAttribute(string $attribute, mixed $value)
Attach a single attribute to this object.
in AttributeTrait at line 55
array
attributes()
Return the list of attributes for this object.
at line 145
__construct(array $options = [])
Instantiate a new Span instance.
at line 196
DateTimeInterface
startTime()
Retrieve the start time for this span.
at line 208
setStartTime(DateTimeInterface|int|float $when = null)
Set the start time for this span.
at line 218
DateTimeInterface
endTime()
Retrieve the end time for this span.
at line 230
setEndTime(DateTimeInterface|int|float $when = null)
Set the end time for this span.
at line 240
string
spanId()
Retrieve the ID of this span.
at line 250
string
parentSpanId()
Retrieve the ID of this span's parent if it exists.
at line 260
string
name()
Retrieve the name of this span.
at line 270
addTimeEvents(array $timeEvents)
Add time events to this span.
at line 282
addTimeEvent(TimeEvent $timeEvent)
Add a time event to this span.
at line 292
TimeEvent[]
timeEvents()
Return the time events for this span.
at line 302
addLinks(array $links)
Add links to this span.
at line 314
addLink(Link $link)
Add a link to this span.
at line 324
Link[]
links()
Return the links for this span.
at line 335
setStatus(int $code, string $message)
Set the status for this span.
at line 345
Status
status()
Retrieve the final status for this span.
at line 355
array
stackTrace()
Retrieve the stackTrace at the moment this span was created
at line 365
bool
sameProcessAsParentSpan()
Whether or not this span is in the same process as its parent.