Middleware
class Middleware
| internal |
Traits
Properties
| protected Transaction|null | $transaction | The current active transaction. |
|
| protected Span|null | $appSpan | The span for the |
Methods
Call the callback with the current span if it is sampled.
Get the status of an operation that cancellation stopped.
Create a new tracing middleware instance.
Complete the transaction when cancellation stopped the request before it terminated.
Finish the current transaction.
Signal that a route was matched for the current request.
Details
in
WorksWithSpans at line 18
protected Span|null
getParentSpanIfSampled()
Get the current span if it is sampled.
in
WorksWithSpans at line 35
protected void
withParentSpanIfSampled(callable $callback)
Call the callback with the current span if it is sampled.
in
WorksWithSpans at line 53
protected SpanStatus|null
cancellationStatus(Throwable $cancellation, Throwable|null $exception = null)
Get the status of an operation that cancellation stopped.
A direct cancellation with no earlier failure leaves the status unset: it is control flow, and the SDK has no canceled status. A known failure, or a cleanup failure carrying the cancellation, is an error.
at line 52
__construct(bool $continueAfterResponse = true, bool $traceMissingRoutes = false)
Create a new tracing middleware instance.
at line 76
void
terminate(Request $request, Response $response)
Perform cleanup after the response has been sent.
When after-response tracing is enabled, a Coroutine::defer() registered in startTransaction() finishes the transaction after deferred work.
at line 106
void
requestCanceled(RequestCanceled $event)
Complete the transaction when cancellation stopped the request before it terminated.
at line 285
void
finishTransaction()
Finish the current transaction.
at line 319
static void
signalRouteWasMatched()
Signal that a route was matched for the current request.