class PoolInstrumentation extends AbstractInstrumentation

Constants

protected CONNECTION_COUNT_METRIC

protected CONNECTION_LIMIT_METRIC

protected CONNECTION_PENDING_REQUESTS_METRIC

protected CONNECTION_POOL_NAME_ATTRIBUTE

protected CONNECTION_STATE_ATTRIBUTE

protected STATE_IDLE

protected STATE_USED

protected OBJECTS_METRIC

protected OBJECTS_LIMIT_METRIC

protected OBJECTS_PENDING_REQUESTS_METRIC

protected OBJECT_POOL_NAME_ATTRIBUTE

protected OBJECT_POOL_STATE_ATTRIBUTE

Properties

protected InstrumentationOptions $options from  AbstractInstrumentation

Methods

void
register(array $options)

Register the instrumentation with normalized options.

void
registerInstrumentation()

Register pool instruments and collection callbacks.

bool
tracesEnabled()

Determine whether trace output is enabled.

bool
metricEnabled(string $name)

Determine whether a metric is enabled.

bool
isDirectCancellation(Throwable|null $exception)

Determine whether the throwable is a direct coroutine cancellation.

string
schemaUrl()

Return the semantic conventions schema URL for Hypervel instrumentation scopes.

array
indexObservers(array $names, array $observers)

Index callback observers by their matching instrument name.

__construct(PoolManager $databasePools, PoolManager $redisPools, PoolManager $objectPools, MeterProviderInterface $meterProvider)

Create pool instrumentation.

ObservableUpDownCounterInterface
createInstrument(MeterInterface $meter, string $name)

Create one observable pool instrument.

void
observeConnectionPools(array $observers)

Record snapshots from every existing database and Redis connection pool.

void
observeConnectionPool(array $observers, ConnectionPool $pool, string $name)

Record one existing connection-pool snapshot.

void
observeObjectPools(array $observers)

Record snapshots from every existing object pool.

Details

final void register(array $options)

Register the instrumentation with normalized options.

Parameters

array $options

Return Value

void

at line 58
protected void registerInstrumentation()

Register pool instruments and collection callbacks.

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 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.

Parameters

Throwable|null $exception

Return Value

bool

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.

Return Value

string

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 47
__construct(PoolManager $databasePools, PoolManager $redisPools, PoolManager $objectPools, MeterProviderInterface $meterProvider)

Create pool instrumentation.

Parameters

PoolManager $databasePools
PoolManager $redisPools
PoolManager $objectPools
MeterProviderInterface $meterProvider

at line 113
protected ObservableUpDownCounterInterface createInstrument(MeterInterface $meter, string $name)

Create one observable pool instrument.

Parameters

MeterInterface $meter
string $name

Return Value

ObservableUpDownCounterInterface

at line 150
protected void observeConnectionPools(array $observers)

Record snapshots from every existing database and Redis connection pool.

Parameters

array $observers

Return Value

void

at line 166
protected void observeConnectionPool(array $observers, ConnectionPool $pool, string $name)

Record one existing connection-pool snapshot.

Parameters

array $observers
ConnectionPool $pool
string $name

Return Value

void

at line 202
protected void observeObjectPools(array $observers)

Record snapshots from every existing object pool.

Parameters

array $observers

Return Value

void