RequestHandler
class RequestHandler
This class manages the logic for sampling and reporting a trace within a single request. It is not meant to be used directly -- instead, it should be managed by the Tracer as its singleton instance.
Constants
DEFAULT_ROOT_SPAN_NAME |
|
ATTRIBUTE_MAP |
|
Methods
Create a new RequestHandler.
The function registered as the shutdown function. Cleans up the trace and reports using the provided ExporterInterface. Adds additional attributes to the root span detected from the response.
Return the tracer used for this request.
Instrument a callable by creating a Span that manages the startTime and endTime. If an exception is thrown while executing the callable, the exception will be caught, the span will be closed, and the exception will be re-thrown.
Explicitly start a new Span. You will need to manage finishing the Span, including handling any thrown exceptions.
Add an attribute to the provided Span
Add an annotation to the provided Span
Add a link to the provided Span
Add an message event to the provided Span
No description
Details
at line 87
__construct(ExporterInterface $exporter, SamplerInterface $sampler, PropagatorInterface $propagator, array $options = [])
Create a new RequestHandler.
at line 135
onExit()
The function registered as the shutdown function. Cleans up the trace and reports using the provided ExporterInterface. Adds additional attributes to the root span detected from the response.
at line 149
TracerInterface
tracer()
Return the tracer used for this request.
at line 165
mixed
inSpan(array $spanOptions, callable $callable, array $arguments = [])
Instrument a callable by creating a Span that manages the startTime and endTime. If an exception is thrown while executing the callable, the exception will be caught, the span will be closed, and the exception will be re-thrown.
at line 178
Span
startSpan(array $spanOptions = [])
Explicitly start a new Span. You will need to manage finishing the Span, including handling any thrown exceptions.
at line 190
Scope
withSpan(Span $span)
Attaches the provided span as the current span and returns a Scope object which must be closed.
at line 204
addAttribute(string $attribute, string $value, array $options = [])
Add an attribute to the provided Span
at line 219
addAnnotation(string $description, array $options = [])
Add an annotation to the provided Span
at line 237
addLink(string $traceId, string $spanId, array $options = [])
Add a link to the provided Span
at line 257
addMessageEvent(string $type, string $id, array $options)
Add an message event to the provided Span