interface HttpDiagnosticsObserverInterface (View source)

Receives optional profiling data without owning the framework's HTTP measurements.

The integration owner must isolate observer failures from request handling and release the observer on every exit. This contract alone does not activate instrumentation.

Methods

void
checkpoint(HttpCheckpoint $checkpoint, float $elapsedMs)

Receives an actual boundary on the same monotonic origin as the final duration.

void
void

Receives the authoritative completed summary; implementations must not recompute its totals.

void
ResponseInterface
response(ServerRequestInterface $request, ResponseInterface $response, RouteMatch|null $match)

Publishes the completed capture and optionally decorates the response after measurement ends.

ResponseInterface

Details

checkpoint

void checkpoint(HttpCheckpoint $checkpoint, float $elapsedMs)

Receives an actual boundary on the same monotonic origin as the final duration.

RequestStarted at zero begins a fresh capture. Call only when observed; do not synthesize completion checkpoints for skipped or failed operations.

Parameters

HttpCheckpoint $checkpoint
float $elapsedMs

Return Value

void

completed

void completed(HttpMetrics $metrics)

Receives the authoritative completed summary; implementations must not recompute its totals.

Parameters

HttpMetrics $metrics

Return Value

void

response

ResponseInterface response(ServerRequestInterface $request, ResponseInterface $response, RouteMatch|null $match)

Publishes the completed capture and optionally decorates the response after measurement ends.

The caller preserves the original response if publishing fails. The matched route is captured before request-scope cleanup; no closed scope needs to be resolved here.

Parameters

ServerRequestInterface $request
ResponseInterface $response
RouteMatch|null $match

Return Value

ResponseInterface