OtelObservability
in package
implements
Observability
Tags
Table of Contents
Interfaces
Methods
- __construct() : mixed
- attachExportActor() : void
- Spawns the {@see OtlpExportActor} that owns all OTLP flush I/O and attaches the three {@see AsyncExportHandles} forwarders to it, draining any batches buffered before this call. Requires {@see \Monadial\Nexus\Observability\Config\ObservabilityConfig::$asyncExport} to have been enabled when this instance was built via {@see ObservabilityFactory}.
- currentContext() : Context
- Returns the ambient active context — the span currently in scope — for injection into outgoing carriers (message metadata / HTTP headers).
- forceFlush() : void
- isEnabled() : bool
- Whether a real telemetry backend is wired. When false, instrumentation call sites should skip work entirely (zero overhead).
- meter() : Meter
- propagator() : ContextPropagator
- psrLogger() : LoggerInterface
- A PSR-3 logger that exports records over OTLP (correlated with the active trace).
- shutdown() : void
- Flush pending telemetry and stop the provider. Called once during application shutdown; a no-op provider does nothing.
- tracer() : Tracer
Methods
__construct()
public
__construct(TracerProviderInterface $tracerProvider, MeterProviderInterface $meterProvider, ContextPropagator $propagator[, string $instrumentationScope = 'nexus' ][, LoggerProviderInterface|null $loggerProvider = null ][, AsyncExportHandles|null $asyncExportHandles = null ]) : mixed
Parameters
- $tracerProvider : TracerProviderInterface
- $meterProvider : MeterProviderInterface
- $propagator : ContextPropagator
- $instrumentationScope : string = 'nexus'
- $loggerProvider : LoggerProviderInterface|null = null
- $asyncExportHandles : AsyncExportHandles|null = null
attachExportActor()
Spawns the {@see OtlpExportActor} that owns all OTLP flush I/O and attaches the three {@see AsyncExportHandles} forwarders to it, draining any batches buffered before this call. Requires {@see \Monadial\Nexus\Observability\Config\ObservabilityConfig::$asyncExport} to have been enabled when this instance was built via {@see ObservabilityFactory}.
public
attachExportActor(ActorSystem $system[, string $name = 'otlp-export' ]) : void
Idempotent while the previously attached actor is alive: a second call is a no-op. If that actor has since died, ActorSystem::spawn() prunes it and a second call respawns and re-attaches, restoring Live delivery.
Deliberately never wires an OTel-backed PSR logger into the actor (leaves the NullLogger default) — routing the export actor's own logs back through the OTLP pipeline it drives would create a feedback loop.
Parameters
- $system : ActorSystem
- $name : string = 'otlp-export'
Tags
currentContext()
Returns the ambient active context — the span currently in scope — for injection into outgoing carriers (message metadata / HTTP headers).
public
currentContext() : Context
Attributes
- #[Override]
Return values
ContextforceFlush()
public
forceFlush() : void
isEnabled()
Whether a real telemetry backend is wired. When false, instrumentation call sites should skip work entirely (zero overhead).
public
isEnabled() : bool
Attributes
- #[Override]
Return values
boolmeter()
public
meter() : Meter
Attributes
- #[Override]
Return values
Meterpropagator()
public
propagator() : ContextPropagator
Attributes
- #[Override]
Return values
ContextPropagatorpsrLogger()
A PSR-3 logger that exports records over OTLP (correlated with the active trace).
public
psrLogger([string|null $name = null ]) : LoggerInterface
Returns a no-op logger when logs are not configured. Not part of the Observability contract — callers opt in by depending on the concrete OTel provider.
Parameters
- $name : string|null = null
Return values
LoggerInterfaceshutdown()
Flush pending telemetry and stop the provider. Called once during application shutdown; a no-op provider does nothing.
public
shutdown() : void
Attributes
- #[Override]
tracer()
public
tracer() : Tracer
Attributes
- #[Override]