Flow PHP

Telemetry

FinalYes

Tracer/Meter/Logger are cached per name and version.

Methods

__construct()  : mixed
flush()  : bool
Flush all pending telemetry data.
logger()  : Logger
Get or create a logger for the given scope.
meter()  : Meter
Get or create a meter for the given scope.
registerShutdownFunction()  : $this
Register this instance for automatic shutdown at process end.
shutdown()  : bool
Shutdown all telemetry and release resources.
tracer()  : Tracer
Get or create a tracer for the given scope.

Methods

flush()

Flush all pending telemetry data.

public flush() : bool

Flushes all cached tracers, meters, and loggers. Returns true only if all flush operations succeed.

Return values
bool

logger()

Get or create a logger for the given scope.

public logger(string $name[, string $version = 'unknown' ][, null|string $schemaUrl = null ][, null|Attributes $attributes = null ][, null|Attributes $signalAttributes = null ]) : Logger

Loggers are cached by name, version, schemaUrl, and attributes. Calling this method with the same parameters returns the same Logger instance.

Parameters
$name : string

The name of the instrumentation scope

$version : string = 'unknown'

The version of the instrumentation scope

$schemaUrl : null|string = null

Schema URL for semantic conventions

$attributes : null|Attributes = null

Additional scope attributes

$signalAttributes : null|Attributes = null

Default attributes merged into every emitted log record (per-call values win)

Return values
Logger

meter()

Get or create a meter for the given scope.

public meter(string $name[, string $version = 'unknown' ][, null|string $schemaUrl = null ][, null|Attributes $attributes = null ][, null|Attributes $signalAttributes = null ]) : Meter

Meters are cached by name, version, schemaUrl, and attributes. Calling this method with the same parameters returns the same Meter instance.

Parameters
$name : string

The name of the instrumentation scope

$version : string = 'unknown'

The version of the instrumentation scope

$schemaUrl : null|string = null

Schema URL for semantic conventions

$attributes : null|Attributes = null

Additional scope attributes

$signalAttributes : null|Attributes = null

Default attributes merged into every recorded metric data point (per-call values win)

Return values
Meter

registerShutdownFunction()

Register this instance for automatic shutdown at process end.

public registerShutdownFunction() : $this

This ensures all pending spans, metrics, and logs are exported when the PHP process terminates - including exit() calls, fatal errors, and uncaught exceptions.

Return values
$this —

For method chaining

shutdown()

Shutdown all telemetry and release resources.

public shutdown() : bool

Flushes all pending data, then shuts down all transports. Transport shutdown is idempotent, allowing multiple exporters to share the same transport safely.

Return values
bool

tracer()

Get or create a tracer for the given scope.

public tracer(string $name[, string $version = 'unknown' ][, null|string $schemaUrl = null ][, null|Attributes $attributes = null ][, null|Attributes $signalAttributes = null ]) : Tracer

Tracers are cached by name, version, schemaUrl, and attributes. Calling this method with the same parameters returns the same Tracer instance.

Parameters
$name : string

The name of the instrumentation scope

$version : string = 'unknown'

The version of the instrumentation scope

$schemaUrl : null|string = null

Schema URL for semantic conventions

$attributes : null|Attributes = null

Additional scope attributes

$signalAttributes : null|Attributes = null

Default attributes merged into every started span (per-call values win)

Return values
Tracer
On this page

Search results