class ViewInstrumentation extends AbstractInstrumentation

Constants

protected STATE_CONTEXT_KEY

protected DURATION_METRIC

protected VIEW_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 view observers 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(Factory $views, TracerProviderInterface $tracerProvider, MeterProviderInterface $meterProvider, ClockInterface $clock, LogContextScopeFactory $logContextScopes)

Create view instrumentation.

void
start(View $view)

Start view-render telemetry.

void
finish(View $view, Throwable|null $exception)

Complete view-render telemetry.

takeState(View $view)

Remove and return the matching top view-render state.

Details

final void register(array $options)

Register the instrumentation with normalized options.

Parameters

array $options

Return Value

void

at line 68
protected void registerInstrumentation()

Register view observers 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 56
__construct(Factory $views, TracerProviderInterface $tracerProvider, MeterProviderInterface $meterProvider, ClockInterface $clock, LogContextScopeFactory $logContextScopes)

Create view instrumentation.

Parameters

Factory $views
TracerProviderInterface $tracerProvider
MeterProviderInterface $meterProvider
ClockInterface $clock
LogContextScopeFactory $logContextScopes

at line 100
protected void start(View $view)

Start view-render telemetry.

Parameters

View $view

Return Value

void

at line 141
protected void finish(View $view, Throwable|null $exception)

Complete view-render telemetry.

Parameters

View $view
Throwable|null $exception

Return Value

void

at line 188
protected ViewTelemetryState|null takeState(View $view)

Remove and return the matching top view-render state.

Parameters

View $view

Return Value

ViewTelemetryState|null