ConsoleInstrumentation
class ConsoleInstrumentation extends AbstractInstrumentation
Constants
| protected STATE_CONTEXT_KEY |
|
| protected DURATION_METRIC |
|
| protected COMMAND_ATTRIBUTE |
|
| protected EXIT_CODE_ATTRIBUTE |
|
| protected DURATION_BOUNDARIES |
|
Properties
| protected InstrumentationOptions | $options | from AbstractInstrumentation | |
| protected list<string> | $commands | ||
| protected list<string> | $excludedCommands | ||
| protected TracerInterface|null | $tracer | ||
| protected HistogramInterface|null | $duration |
Methods
Register the instrumentation with normalized options.
Register console 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 console instrumentation.
Determine whether a command is included by the configured patterns.
Details
in
AbstractInstrumentation at line 21
final void
register(array $options)
Register the instrumentation with normalized options.
at line 83
protected void
registerInstrumentation()
Register console 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 68
__construct(Dispatcher $events, TracerProviderInterface $tracerProvider, MeterProviderInterface $meterProvider, ClockInterface $clock, ExceptionContextRegistry $exceptionContexts, OperationOrigin $origins, ProcessIdentity $identity, LogContextScopeFactory $logContextScopes)
Create console instrumentation.
at line 127
protected void
start(BeforeHandle $event)
Start console-command telemetry.
at line 176
protected void
finish(AfterExecute $event)
Complete console-command telemetry.
at line 239
protected ConsoleTelemetryState|null
takeState(Command $command)
Remove and return the matching top console-command state.
at line 263
protected bool
shouldRecord(string $command)
Determine whether a command is included by the configured patterns.