class ScoutInstrumentation extends AbstractInstrumentation implements EngineOperationObserver

Constants

protected MODEL_ATTRIBUTE

protected DURATION_BOUNDARIES

Properties

protected InstrumentationOptions $options from  AbstractInstrumentation
protected TracerInterface|null $tracer
protected HistogramInterface|null $duration

Methods

void
register(array $options)

Register the instrumentation with normalized options.

void
registerInstrumentation()

Register the Scout operation observer and instruments.

bool
tracesEnabled()

Determine whether trace output is enabled.

bool
metricEnabled(string $name)

Determine whether a metric is enabled.

array
indexObservers(array $names, array $observers)

Index callback observers by their matching instrument name.

__construct(EngineOperationRunner $operations, TracerProviderInterface $tracerProvider, MeterProviderInterface $meterProvider, ClockInterface $clock, LogContextScopeFactory $logContextScopes)

Create Scout instrumentation.

mixed
starting(EngineOperation $operation)

Start observing a Scout engine operation.

void
finished(EngineOperation $operation, mixed $token, Throwable|null $exception)

Finish observing a Scout engine operation.

array
metricAttributes(EngineOperation $operation)

Return metric-safe Scout engine-operation attributes.

Details

final void register(array $options)

Register the instrumentation with normalized options.

Parameters

array $options

Return Value

void

at line 61
protected void registerInstrumentation()

Register the Scout operation observer and instruments.

Return Value

void

protected bool tracesEnabled()

Determine whether trace output is enabled.

Return Value

bool

protected bool metricEnabled(string $name)

Determine whether a metric is enabled.

Parameters

string $name

Return Value

bool

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.

Parameters

array $names
array $observers

Return Value

array

at line 49
__construct(EngineOperationRunner $operations, TracerProviderInterface $tracerProvider, MeterProviderInterface $meterProvider, ClockInterface $clock, LogContextScopeFactory $logContextScopes)

Create Scout instrumentation.

Parameters

EngineOperationRunner $operations
TracerProviderInterface $tracerProvider
MeterProviderInterface $meterProvider
ClockInterface $clock
LogContextScopeFactory $logContextScopes

at line 86
mixed starting(EngineOperation $operation)

Start observing a Scout engine operation.

Parameters

EngineOperation $operation

Return Value

mixed

at line 128
void finished(EngineOperation $operation, mixed $token, Throwable|null $exception)

Finish observing a Scout engine operation.

Parameters

EngineOperation $operation
mixed $token
Throwable|null $exception

Return Value

void

at line 170
protected array metricAttributes(EngineOperation $operation)

Return metric-safe Scout engine-operation attributes.

Parameters

EngineOperation $operation

Return Value

array