OpenTelemetryMetricsRecorder
in package
implements
MetricsRecorder
FinalYes
Forwards SDK observations to the application's OpenTelemetry meter provider.
Requires the optional open-telemetry/api package, which the SDK already
suggests for tracing. The application owns the provider, its readers and
exporters, and any resource attributes. Counters use unit "1" and durations
use seconds ("s"), matching the shared SDK metrics contract.
Table of Contents
Interfaces
- MetricsRecorder
- Application-owned sink for process observations, with no exporter dependency.
Properties
- $counters : array<string, CounterInterface>
- $histograms : array<string, HistogramInterface>
- $meter : MeterInterface
Methods
- __construct() : mixed
- increment() : void
- record() : void
Properties
$counters
private
array<string, CounterInterface>
$counters
= []
$histograms
private
array<string, HistogramInterface>
$histograms
= []
$meter read-only
private
MeterInterface
$meter
Methods
__construct()
public
__construct(MeterProviderInterface $meterProvider[, string $instrumentationScope = 'durable-workflow/sdk' ]) : mixed
Parameters
- $meterProvider : MeterProviderInterface
- $instrumentationScope : string = 'durable-workflow/sdk'
increment()
public
increment(string $name[, float $value = 1.0 ][, array<string|int, mixed> $tags = [] ]) : void
Parameters
- $name : string
- $value : float = 1.0
- $tags : array<string|int, mixed> = []
record()
public
record(string $name, float $value[, array<string|int, mixed> $tags = [] ]) : void
Parameters
- $name : string
- $value : float
- $tags : array<string|int, mixed> = []