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
Add an attribute to this span.
Instantiate a new Span instance.
Retrieve the ID of this span.
Mark this span as attached.
Returns whether or not this span has been attached.
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.
at line 325
addAttribute(string $attribute, string $value)
Add an attribute to this span.
in AttributeTrait at line 55
array
attributes()
Return the list of attributes for this object.
at line 186
__construct(array $options = [])
Instantiate a new Span instance.
at line 248
setStartTime(DateTimeInterface|int|float $when = null)
Set the start time for this span.
at line 260
setEndTime(DateTimeInterface|int|float $when = null)
Set the end time for this span.
at line 270
string
spanId()
Retrieve the ID of this span.
at line 280
SpanData
spanData()
Return a read-only version of this span.
at line 304
attach()
Mark this span as attached.
at line 314
bool
attached()
Returns whether or not this span has been attached.
at line 336
addTimeEvents(array $timeEvents)
Add time events to this span.
at line 348
addTimeEvent(TimeEvent $timeEvent)
Add a time event to this span.
at line 359
addLinks(array $links)
Add links to this span.
at line 371
addLink(Link $link)
Add a link to this span.
at line 383
setStatus(int $code, string $message)
Set the status for this span.