CacheInstrumentation
class CacheInstrumentation extends AbstractInstrumentation
Traits
Constants
| protected OPERATIONS_METRIC |
|
Properties
| protected InstrumentationOptions | $options | from AbstractInstrumentation | |
| protected bool | $traceEvents | ||
| protected bool | $captureKey | ||
| protected int|null | $keyMaxLength | ||
| protected CounterInterface|null | $operations |
Methods
Register the instrumentation with normalized options.
Register cache listeners and instruments.
Determine whether a metric is enabled.
Index callback observers by their matching instrument name.
Create cache instrumentation.
Return the recording active span when trace events are enabled.
Resolve the bounded cache key.
Details
in
AbstractInstrumentation at line 18
final void
register(array $options)
Register the instrumentation with normalized options.
at line 59
protected void
registerInstrumentation()
Register cache listeners and instruments.
in
AbstractInstrumentation at line 32
protected bool
tracesEnabled()
Determine whether trace output is enabled.
in
AbstractInstrumentation at line 40
protected bool
metricEnabled(string $name)
Determine whether a metric is enabled.
in
AbstractInstrumentation at line 55
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 49
__construct(Dispatcher $events, MeterProviderInterface $meterProvider, OpenTelemetryManager $openTelemetry)
Create cache instrumentation.
at line 141
protected void
record(string $operation, string $result, string|null $store, int $count = 1, Throwable|null $exception = null, string|null $key = null, int|null $timeToLive = null, string|null $failedStore = null)
Record one completed cache operation.
at line 189
protected SpanInterface|null
recordingSpan()
Return the recording active span when trace events are enabled.
at line 203
protected string|null
key(string $key, string|null $store)
Resolve the bounded cache key.