class OpenTelemetryManager

Properties

protected Closure> $customCreators
protected ExporterFactory> $exporterFactories
protected Closure> $exceptionEnrichers
protected Closure|null $urlTemplateResolver
protected Closure|null $userResolver
protected Closure|null $cacheKeyResolver
protected Closure|null $redisQueryTextResolver
protected ProviderSet|null $providers
protected ProcessIdentity|null $identity
protected array<string, mixed> $normalizedConfiguration
protected bool $bound
protected bool $closed
protected bool $flushing
protected bool $closing
protected Channel|null $flushCompletion

Methods

__construct(Container $container, Repository $config, ConfigurationNormalizer $normalizer, ProviderFactory $providerFactory, ExceptionContextRegistry $exceptionContexts, OperationOrigin $origins, MeterProviderInterface $meterProvider, TracerProviderInterface $tracerProvider, LoggerProviderInterface $loggerProvider, DeferredMeterProvider|null $deferredMeterProvider, DeferredTracerProvider|null $deferredTracerProvider, DeferredLoggerProvider|null $deferredLoggerProvider, TextMapPropagatorInterface $textMapPropagator, ResponsePropagatorInterface $responsePropagator, bool $enabled)

Create a new OpenTelemetry manager.

MeterInterface
meter(string $name = 'hypervel.application', string|null $version = null, string|null $schemaUrl = null, iterable $attributes = [])

Return a meter for an instrumentation scope.

TracerInterface
tracer(string $name = 'hypervel.application', string|null $version = null, string|null $schemaUrl = null, iterable $attributes = [])

Return a tracer for an instrumentation scope.

LoggerInterface
logger(string $name = 'hypervel.application', string|null $version = null, string|null $schemaUrl = null, iterable $attributes = [])

Return a logger for an instrumentation scope.

mixed
trace(string $name, Closure $callback, iterable $attributes = [])

Run a callback inside an internal span.

TextMapPropagatorInterface
propagator()

Return the configured text-map propagator.

ResponsePropagatorInterface
responsePropagator()

Return the configured response propagator.

array
inject(array $carrier = [], ContextInterface|null $context = null)

Inject the current or supplied context into an array carrier.

ContextInterface
extract(array $carrier, ContextInterface|null $context = null)

Extract context from an array carrier.

void
bind(ProcessIdentity $identity)

Bind worker-local SDK providers to the pre-fork graph.

bool
flush()

Flush every enabled provider.

bool|null
flushSignals(array $signals)

Flush selected signals without overlapping another export operation.

bool
shutdown()

Shut down every enabled provider and release worker-local delegates.

bool
isBound()

Determine whether a worker-local graph is bound.

bool
logsEnabled()

Determine whether the logs signal is active in this process.

array
configuration()

Return normalized worker configuration.

void
extend(string $driver, Closure $factory)

Register a custom exporter driver.

void
enrichExceptionsUsing(Closure $enricher)

Register an exception-record enricher.

array
exceptionEnrichers()

Return registered exception-record enrichers.

void
resolveUrlTemplateUsing(Closure $resolver)

Set the outgoing URL-template resolver.

Closure|null
urlTemplateResolver()

Return the outgoing URL-template resolver.

void
resolveUserUsing(Closure $resolver)

Set the authenticated-user resolver.

Closure|null
userResolver()

Return the authenticated-user resolver.

void
resolveCacheKeyUsing(Closure $resolver)

Set the cache-key resolver.

Closure|null
cacheKeyResolver()

Return the cache-key resolver.

void
resolveRedisQueryTextUsing(Closure $resolver)

Set the Redis query-text resolver.

Closure|null
redisQueryTextResolver()

Return the Redis query-text resolver.

void
registerInstrumentations(ProcessIdentity $identity)

Resolve and register active worker-local instrumentations.

resolveExporterFactory(string $driver)

Resolve and cache an exporter factory.

Details

at line 85
__construct(Container $container, Repository $config, ConfigurationNormalizer $normalizer, ProviderFactory $providerFactory, ExceptionContextRegistry $exceptionContexts, OperationOrigin $origins, MeterProviderInterface $meterProvider, TracerProviderInterface $tracerProvider, LoggerProviderInterface $loggerProvider, DeferredMeterProvider|null $deferredMeterProvider, DeferredTracerProvider|null $deferredTracerProvider, DeferredLoggerProvider|null $deferredLoggerProvider, TextMapPropagatorInterface $textMapPropagator, ResponsePropagatorInterface $responsePropagator, bool $enabled)

Create a new OpenTelemetry manager.

Parameters

Container $container
Repository $config
ConfigurationNormalizer $normalizer
ProviderFactory $providerFactory
ExceptionContextRegistry $exceptionContexts
OperationOrigin $origins
MeterProviderInterface $meterProvider
TracerProviderInterface $tracerProvider
LoggerProviderInterface $loggerProvider
DeferredMeterProvider|null $deferredMeterProvider
DeferredTracerProvider|null $deferredTracerProvider
DeferredLoggerProvider|null $deferredLoggerProvider
TextMapPropagatorInterface $textMapPropagator
ResponsePropagatorInterface $responsePropagator
bool $enabled

at line 107
MeterInterface meter(string $name = 'hypervel.application', string|null $version = null, string|null $schemaUrl = null, iterable $attributes = [])

Return a meter for an instrumentation scope.

Parameters

string $name
string|null $version
string|null $schemaUrl
iterable $attributes

Return Value

MeterInterface

at line 119
TracerInterface tracer(string $name = 'hypervel.application', string|null $version = null, string|null $schemaUrl = null, iterable $attributes = [])

Return a tracer for an instrumentation scope.

Parameters

string $name
string|null $version
string|null $schemaUrl
iterable $attributes

Return Value

TracerInterface

at line 131
LoggerInterface logger(string $name = 'hypervel.application', string|null $version = null, string|null $schemaUrl = null, iterable $attributes = [])

Return a logger for an instrumentation scope.

Parameters

string $name
string|null $version
string|null $schemaUrl
iterable $attributes

Return Value

LoggerInterface

at line 143
mixed trace(string $name, Closure $callback, iterable $attributes = [])

Run a callback inside an internal span.

Parameters

string $name
Closure $callback
iterable $attributes

Return Value

mixed

at line 182
TextMapPropagatorInterface propagator()

Return the configured text-map propagator.

Return Value

TextMapPropagatorInterface

at line 192
ResponsePropagatorInterface responsePropagator()

internal  
 

Return the configured response propagator.

Return Value

ResponsePropagatorInterface

at line 203
array inject(array $carrier = [], ContextInterface|null $context = null)

Inject the current or supplied context into an array carrier.

Parameters

array $carrier
ContextInterface|null $context

Return Value

array

at line 215
ContextInterface extract(array $carrier, ContextInterface|null $context = null)

Extract context from an array carrier.

Parameters

array $carrier
ContextInterface|null $context

Return Value

ContextInterface

at line 229
void bind(ProcessIdentity $identity)

internal  
 

Bind worker-local SDK providers to the pre-fork graph.

Parameters

ProcessIdentity $identity

Return Value

void

at line 276
bool flush()

Flush every enabled provider.

Return Value

bool

at line 291
bool|null flushSignals(array $signals)

internal  
 

Flush selected signals without overlapping another export operation.

Parameters

array $signals

Return Value

bool|null

true when completed or nothing is bound, false on provider failure, or null when another flush or shutdown owns the graph

at line 337
bool shutdown()

internal  
 

Shut down every enabled provider and release worker-local delegates.

Return Value

bool

at line 391
bool isBound()

internal  
 

Determine whether a worker-local graph is bound.

Return Value

bool

at line 401
bool logsEnabled()

internal  
 

Determine whether the logs signal is active in this process.

Return Value

bool

at line 412
array configuration()

internal  
 

Return normalized worker configuration.

Return Value

array

at line 422
void extend(string $driver, Closure $factory)

Register a custom exporter driver.

Boot-only. The creator persists for the worker lifetime and must be registered before telemetry binding.

Parameters

string $driver
Closure $factory

Return Value

void

at line 433
void enrichExceptionsUsing(Closure $enricher)

Register an exception-record enricher.

Boot-only. The callback persists for the worker lifetime and affects every reported exception.

Parameters

Closure $enricher

Return Value

void

at line 444
array exceptionEnrichers()

internal  
 

Return registered exception-record enrichers.

Return Value

array

at line 454
void resolveUrlTemplateUsing(Closure $resolver)

Set the outgoing URL-template resolver.

Boot-only. The callback persists for the worker lifetime and affects every traced outgoing request.

Parameters

Closure $resolver

Return Value

void

at line 464
Closure|null urlTemplateResolver()

internal  
 

Return the outgoing URL-template resolver.

Return Value

Closure|null

at line 474
void resolveUserUsing(Closure $resolver)

Set the authenticated-user resolver.

Boot-only. The callback persists for the worker lifetime and affects every request that collects user context.

Parameters

Closure $resolver

Return Value

void

at line 484
Closure|null userResolver()

internal  
 

Return the authenticated-user resolver.

Return Value

Closure|null

at line 494
void resolveCacheKeyUsing(Closure $resolver)

Set the cache-key resolver.

Boot-only. The callback persists for the worker lifetime and affects enabled cache-key capture.

Parameters

Closure $resolver

Return Value

void

at line 504
Closure|null cacheKeyResolver()

internal  
 

Return the cache-key resolver.

Return Value

Closure|null

at line 514
void resolveRedisQueryTextUsing(Closure $resolver)

Set the Redis query-text resolver.

Boot-only. The callback persists for the worker lifetime and affects enabled Redis query-text capture.

Parameters

Closure $resolver

Return Value

void

at line 524
Closure|null redisQueryTextResolver()

internal  
 

Return the Redis query-text resolver.

Return Value

Closure|null

at line 532
protected void registerInstrumentations(ProcessIdentity $identity)

Resolve and register active worker-local instrumentations.

Parameters

ProcessIdentity $identity

Return Value

void

at line 563
protected ExporterFactory resolveExporterFactory(string $driver)

Resolve and cache an exporter factory.

Parameters

string $driver

Return Value

ExporterFactory