SpanEvent
Interface for events recorded within a span.
Events mark significant points in time during a span's lifetime, such as errors, state changes, or notable occurrences.
Methods
- attributes() : array<string, array<string|int, bool|float|int|string>|bool|float|int|string>
- Get the event attributes.
- attributesObject() : Attributes
- Get the event attributes as an Attributes object.
- fromArray() : self
- Create a SpanEvent from a normalized array representation.
- name() : string
- Get the event name.
-
normalize()
: array{name: string, timestamp: string, attributes: array
} - Normalize the event to an array representation for serialization.
- timestamp() : DateTimeImmutable
- Get the event timestamp.
Methods
attributes()
Get the event attributes.
public
attributes() : array<string, array<string|int, bool|float|int|string>|bool|float|int|string>
Return values
array<string, array<string|int, bool|float|int|string>|bool|float|int|string>attributesObject()
Get the event attributes as an Attributes object.
public
attributesObject() : Attributes
Return values
AttributesfromArray()
Create a SpanEvent from a normalized array representation.
public
static fromArray(array{name: string, timestamp: string, attributes: array} $data) : self
Parameters
-
$data
: array{name: string, timestamp: string, attributes: array
} -
Normalized event data
Return values
selfname()
Get the event name.
public
name() : string
Return values
stringnormalize()
Normalize the event to an array representation for serialization.
public
normalize() : array{name: string, timestamp: string, attributes: array}
Return values
array{name: string, timestamp: string, attributes: arraytimestamp()
Get the event timestamp.
public
timestamp() : DateTimeImmutable