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
Constants
ATTRIBUTE_HOST |
|
ATTRIBUTE_PORT |
|
ATTRIBUTE_METHOD |
|
ATTRIBUTE_PATH |
|
ATTRIBUTE_ROUTE |
|
ATTRIBUTE_USER_AGENT |
|
ATTRIBUTE_STATUS_CODE |
|
KIND_UNSPECIFIED |
|
KIND_SERVER |
|
KIND_CLIENT |
|
Methods
Attach a single attribute to this object.
Instantiate a new Span instance.
Retrieve the ID of this span.
Add time events to this span.
Add links to this span.
Set the status for this span.
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 169
__construct(array $options = [])
Instantiate a new Span instance.
at line 227
setStartTime(DateTimeInterface|int|float $when = null)
Set the start time for this span.
at line 239
setEndTime(DateTimeInterface|int|float $when = null)
Set the end time for this span.
at line 249
string
spanId()
Retrieve the ID of this span.
at line 259
SpanData
spanData()
Return a read-only version of this span.
at line 285
addTimeEvents(array $timeEvents)
Add time events to this span.
at line 297
addTimeEvent(TimeEvent $timeEvent)
Add a time event to this span.
at line 307
addLinks(array $links)
Add links to this span.
at line 319
addLink(Link $link)
Add a link to this span.
at line 330
setStatus(int $code, string $message)
Set the status for this span.