HttpDiagnosticsObserverInterface
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
Receives an actual boundary on the same monotonic origin as the final duration.
Receives the authoritative completed summary; implementations must not recompute its totals.
Publishes the completed capture and optionally decorates the response after measurement ends.
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.
completed
void
completed(HttpMetrics $metrics)
Receives the authoritative completed summary; implementations must not recompute its totals.
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.