OpenTelemetry PHP

GaugeInterface extends SynchronousInstrument

A synchronous instrument which can be used to record non-additive values.

Tags
see
https://opentelemetry.io/docs/specs/otel/metrics/api/#gauge
experimental

Table of Contents

Methods

isEnabled()  : bool
Determine if the instrument is enabled. Instrumentation authors SHOULD call this API each time they record a measurement.
record()  : void

Methods

isEnabled()

Determine if the instrument is enabled. Instrumentation authors SHOULD call this API each time they record a measurement.

public isEnabled() : bool

MUST return false if:

  • The MeterConfig of the Meter used to create the instrument has parameter disabled=true
  • All resolved views for the instrument are configured with the Drop Aggregation
Tags
experimental
see
https://opentelemetry.io/docs/specs/otel/metrics/sdk/#instrument-enabled
Return values
bool

record()

public record(float|int $amount[, iterable<non-empty-string, string|bool|float|int|array<string|int, mixed>|null> $attributes = [] ][, ContextInterface|false|null $context = null ]) : void
Parameters
$amount : float|int

current absolute value

$attributes : iterable<non-empty-string, string|bool|float|int|array<string|int, mixed>|null> = []

attributes of the data point

$context : ContextInterface|false|null = null

execution context

Tags
see
https://opentelemetry.io/docs/specs/otel/metrics/api/#record-1

        
On this page

Search results