HttpServerInstrumentation
class HttpServerInstrumentation extends AbstractInstrumentation
Constants
| protected DURATION_BOUNDARIES |
|
| protected ACTIVE_REQUESTS_METRIC |
|
Properties
| protected InstrumentationOptions | $options | from AbstractInstrumentation | |
| protected array<string, true> | $knownMethods | ||
| protected array<string, true> | $excludedMethods | ||
| protected list<string> | $excludedPaths | ||
| protected bool | $userContext | ||
| protected bool | $userContextOnly | ||
| protected TracerInterface|null | $tracer | ||
| protected HistogramInterface|null | $duration | ||
| protected UpDownCounterInterface|null | $activeRequests | ||
| protected HttpTelemetryAttributes | $httpAttributes |
Methods
Register the instrumentation with normalized options.
Register HTTP server listeners and instruments.
Determine whether a metric is enabled.
Determine whether the throwable is a direct coroutine cancellation.
Return the semantic conventions schema URL for Hypervel instrumentation scopes.
Index callback observers by their matching instrument name.
Create HTTP server instrumentation.
Return attributes available when request processing starts.
Return recording-only request attributes.
Return attributes available when request processing completes.
Return recording-only response attributes.
Return the application exception retained by a Hypervel response.
Details
in
AbstractInstrumentation at line 21
final void
register(array $options)
Register the instrumentation with normalized options.
at line 108
protected void
registerInstrumentation()
Register HTTP server listeners and instruments.
in
AbstractInstrumentation at line 35
protected bool
tracesEnabled()
Determine whether trace output is enabled.
in
AbstractInstrumentation at line 43
protected bool
metricEnabled(string $name)
Determine whether a metric is enabled.
in
AbstractInstrumentation at line 53
protected bool
isDirectCancellation(Throwable|null $exception)
Determine whether the throwable is a direct coroutine cancellation.
Ending an operation by direct cancellation is control flow, not a failure.
in
AbstractInstrumentation at line 64
protected string
schemaUrl()
Return the semantic conventions schema URL for Hypervel instrumentation scopes.
Every tracer, meter and logger obtained for one scope must pass the same URL.
in
AbstractInstrumentation at line 79
protected array
indexObservers(array $names, array $observers)
Index callback observers by their matching instrument name.
The SDK supplies observers in the same order as the instruments passed to batchObserve(), so the unchanged name order is the mapping contract.
at line 91
__construct(Dispatcher $events, TracerProviderInterface $tracerProvider, MeterProviderInterface $meterProvider, TextMapPropagatorInterface $propagator, ResponsePropagatorInterface $responsePropagator, HeaderBagGetter $headerGetter, ResponseHeadersSetter $responseSetter, ClockInterface $clock, LogContextScopeFactory $logContextScopes, UserContextResolver $userContexts)
Create HTTP server instrumentation.
at line 206
protected void
requestReceived(RequestReceived $event)
Start telemetry for an accepted request.
at line 284
protected void
requestHandled(RequestHandled $event)
Inject configured response propagation before transport send.
at line 306
protected void
complete(Request|null $request, Response|null $response, Throwable|null $exception)
Complete telemetry at the response transport boundary, or where cancellation stopped the request.
The response is null when none was sent; the exception is the lifecycle failure, if any.
at line 385
protected array
methodAttributes(Request $request)
Return normalized method attributes for a server request.
at line 409
protected array
activeRequestAttributes(Request $request, array $methodAttributes)
Return attributes available when request processing starts.
at line 423
protected array
requestTraceAttributes(Request $request, array $methodAttributes)
Return recording-only request attributes.
at line 449
protected array
completionAttributes(Request $request, array $startAttributes, int|null $statusCode, string|null $errorType)
Return attributes available when request processing completes.
at line 473
protected array
responseTraceAttributes(Response $response)
Return recording-only response attributes.
at line 490
protected Throwable|null
responseException(Response|null $response)
Return the application exception retained by a Hypervel response.