Nexus API Reference

ObservabilityConfig
in package

Read onlyYes
FinalYes
Tags
psalm-api
psalm-immutable

Vendor-neutral observability configuration. Pure value object; the OTEL bridge consumes it to build real providers. fromEnv() reads the standard OpenTelemetry environment variables from an injected map (kept pure for testability).

Table of Contents

Properties

$enabled  : bool
$exporterEndpoint  : string|null
$exporterProtocol  : string
$logsEnabled  : bool
$metricsEnabled  : bool
$resourceAttributes  : array<string|int, mixed>
$sampler  : string
$samplerArg  : float|null
$serviceName  : string
$tracesEnabled  : bool

Methods

__construct()  : mixed
disabled()  : self
enabled()  : self
fromEnv()  : self
withEnabled()  : self
withExporterEndpoint()  : self
withSampler()  : self
withServiceName()  : self

Properties

Methods

__construct()

public __construct(bool $enabled, string $serviceName, string|null $exporterEndpoint, string $exporterProtocol, string $sampler, float|null $samplerArg, bool $tracesEnabled, bool $metricsEnabled, bool $logsEnabled, array<string, string> $resourceAttributes) : mixed
Parameters
$enabled : bool
$serviceName : string
$exporterEndpoint : string|null
$exporterProtocol : string
$sampler : string
$samplerArg : float|null
$tracesEnabled : bool
$metricsEnabled : bool
$logsEnabled : bool
$resourceAttributes : array<string, string>

enabled()

public static enabled(string $serviceName) : self
Parameters
$serviceName : string
Return values
self

fromEnv()

public static fromEnv(array<string, string> $env) : self
Parameters
$env : array<string, string>
Return values
self

withEnabled()

public withEnabled(bool $enabled) : self
Parameters
$enabled : bool
Return values
self

withExporterEndpoint()

public withExporterEndpoint(string|null $exporterEndpoint) : self
Parameters
$exporterEndpoint : string|null
Return values
self

withSampler()

public withSampler(string $sampler, float|null $samplerArg) : self
Parameters
$sampler : string
$samplerArg : float|null
Return values
self

withServiceName()

public withServiceName(string $serviceName) : self
Parameters
$serviceName : string
Return values
self

        
On this page

Search results