ExecutionSegmentInterface
interface ExecutionSegmentInterface (View source)
This interface has functionality shared between Transaction and Span.
Methods
Hex encoded 64 random bits (== 8 bytes == 16 hex digits) ID.
Hex encoded 128 random bits (== 16 bytes == 32 hex digits) ID of the correlated trace.
Recorded time of the event.
Begins a new span with this execution segment as the new span's parent.
Begins a new span with this execution segment as the new span's parent, runs the provided callback as the new span and automatically ends the new span.
- For transactions: The name of this transaction.
Type is a keyword of specific relevance in the service's domain e.g.,
- For transaction: 'db', 'external' for a span and 'request', 'backgroundjob' for a transaction, etc.
Returns distributed tracing data for the current span/transaction
Sets the end timestamp and finalizes this object's state.
Returns true if this execution segment has already ended.
Creates an error based on the given Throwable instance with this execution segment as the parent.
Creates an error based on the given Throwable instance with this execution segment as the parent.
The outcome of the transaction/span: success, failure, or unknown.
No description
Returns true if this execution segment is a no-op (for example when recording is disabled).
Discards this execution segment.
Details
string
getId()
Hex encoded 64 random bits (== 8 bytes == 16 hex digits) ID.
string
getTraceId()
Hex encoded 128 random bits (== 16 bytes == 32 hex digits) ID of the correlated trace.
float
getTimestamp()
Recorded time of the event.
For events that have non-zero duration this time corresponds to the start of the event. UTC based and in microseconds since Unix epoch.
SpanInterface
beginChildSpan(string $name, string $type, string|null $subtype = null, string|null $action = null, float|null $timestamp = null)
Begins a new span with this execution segment as the new span's parent.
mixed
captureChildSpan(string $name, string $type, Closure $callback, string|null $subtype = null, string|null $action = null, float|null $timestamp = null)
Begins a new span with this execution segment as the new span's parent, runs the provided callback as the new span and automatically ends the new span.
void
setName(string $name)
- For transactions: The name of this transaction.
Generic designation of a transaction in the scope of a single service (eg: 'GET /users/:id').
- For spans: Generic designation of a span in the scope of a transaction.
The length of this string is limited to 1024.
void
setType(string $type)
Type is a keyword of specific relevance in the service's domain e.g.,
- For transaction: 'db', 'external' for a span and 'request', 'backgroundjob' for a transaction, etc.
- For span: 'db.postgresql.query', 'template.erb', etc.
The length of this string is limited to 1024.
DistributedTracingData|null
getDistributedTracingData()
deprecated
deprecated
No description
void
injectDistributedTracingHeaders(Closure $headerInjector)
Returns distributed tracing data for the current span/transaction
$headerInjector is callback to inject headers with signature
(string $headerName, string $headerValue): void
void
end(float|null $duration = null)
Sets the end timestamp and finalizes this object's state.
If any mutating method (for example any set...
method is a mutating method)
is called on a instance which has already then a warning is logged.
For example, end() is a mutating method as well.
bool
hasEnded()
Returns true if this execution segment has already ended.
string|null
createErrorFromThrowable(Throwable $throwable)
Creates an error based on the given Throwable instance with this execution segment as the parent.
string|null
createCustomError(CustomErrorData $customErrorData)
Creates an error based on the given Throwable instance with this execution segment as the parent.
void
setOutcome(string|null $outcome)
The outcome of the transaction/span: success, failure, or unknown.
Outcome may be one of a limited set of permitted values describing the success or failure of the transaction/span. This field can be used for calculating error rates for incoming/outgoing requests.
string|null
getOutcome()
No description
bool
isNoop()
Returns true if this execution segment is a no-op (for example when recording is disabled).
void
discard()
Discards this execution segment.