OK
OK = 1
A span that finished as expected.
One timed operation, in the shape OpenTelemetry transports.
Wall-clock start and monotonic duration are recorded separately. OTLP wants unix nanoseconds
for both ends of a span, but a wall clock can step - ntp, a leap second, a container resuming -
and a span whose end is stamped from a stepped clock reports a negative duration. So the start is
wall-clock, because a collector has to line the span up against everything else, and the duration
comes from hrtime(), which only ever moves forward. The end is start plus duration.
Ids are random rather than derived. A trace id derived from the operation would collide across two flushes of the same shape, and a collector would splice unrelated work into one trace.
__construct(string $name, string $traceId, string $spanId, int $startNanos, int $durationNanos = 0, array$attributes = [], int $status = \self::OK, string $message = '', string|null $parentId = null) : mixed
Constructs a span.
| string | $name | What was timed, such as "strata.flush". |
| string | $traceId | Thirty-two hex characters. |
| string | $spanId | Sixteen hex characters. |
| int | $startNanos | Unix nanoseconds the span opened at. |
| int | $durationNanos | How long it took, from a monotonic clock. |
| array |
$attributes | What the operation was about. |
| int | $status | Either OK or ERROR. |
| string | $message | Why it failed, when it did. |
| string|null | $parentId | The enclosing span's id, or NULL for a root span. |
close(int $durationNanos, array$attributes = [], int $status = \self::OK, string $message = '') : self
The same span, closed after a measured duration.
| int | $durationNanos | How long it took. |
| array |
$attributes | Attributes to merge in, which is where a result's counts are added. |
| int | $status | Either OK or ERROR. |
| string | $message | Why it failed, when it did. |
The closed span.