class Middleware

internal  
 

Properties

protected Transaction|null $transaction

The current active transaction.

protected Span|null $appSpan

The span for the app.handle part of the application.

Methods

__construct(bool $continueAfterResponse = true, bool $traceMissingRoutes = false)

Create a new tracing middleware instance.

Response
handle(Request $request, Closure $next)

Handle an incoming request.

void
terminate(Request $request, Response $response)

Perform cleanup after the response has been sent.

static void
setBootedTimestamp(float|null $timestamp = null)

Set the timestamp of application bootstrap completion.

static void
signalRouteWasMatched()

Signal that a route was matched for the current request.

void
finishTransaction()

Finish the current transaction.

static void
flushState()

Flush all static state.

Details

at line 52
__construct(bool $continueAfterResponse = true, bool $traceMissingRoutes = false)

Create a new tracing middleware instance.

Parameters

bool $continueAfterResponse
bool $traceMissingRoutes

at line 61
Response handle(Request $request, Closure $next)

Handle an incoming request.

Parameters

Request $request
Closure $next

Return Value

Response

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.

Parameters

Request $request
Response $response

Return Value

void

at line 108
static void setBootedTimestamp(float|null $timestamp = null)

internal  this method should only be invoked right after the application has finished "booting"
 

Set the timestamp of application bootstrap completion.

Boot-only. Sets a process-wide static used by the first-request boot span. Runtime use would race across coroutines.

Parameters

float|null $timestamp

Return Value

void

at line 116
static void signalRouteWasMatched()

Signal that a route was matched for the current request.

Return Value

void

at line 128
void finishTransaction()

Finish the current transaction.

Return Value

void

at line 298
static void flushState()

Flush all static state.

Return Value

void