TracingHookOptions
in package
Immutable configuration for the LaunchDarkly OpenTelemetry tracing hook.
Instances are constructed once and passed to the tracing hook at registration time. All properties are read-only; mutation is not supported. To change configuration, construct a new options object and a new TracingHook.
Tags
Table of Contents
- $addSpans : bool
- Experimental. When true, the tracing hook will create a span for every variation method call in addition to the `feature_flag` span event.
- $environmentId : string|null
- Optional environment ID emitted as the `feature_flag.set.id` attribute on the `feature_flag` span event.
- $includeValue : bool
- When true, the evaluated flag value will be attached to the `feature_flag` span event as the `feature_flag.result.value` attribute.
- $logger : LoggerInterface|null
- Optional PSR-3 logger used to report configuration issues encountered while constructing the options object (for example, an invalid environment ID). When `null`, no diagnostic output is produced.
- __construct() : mixed
- Construct an immutable options object.
Properties
$addSpans read-only
Experimental. When true, the tracing hook will create a span for every variation method call in addition to the `feature_flag` span event.
public
bool
$addSpans
Span events are always added and are unaffected by this setting. The structure and nesting of these spans may change in future versions.
$environmentId read-only
Optional environment ID emitted as the `feature_flag.set.id` attribute on the `feature_flag` span event.
public
string|null
$environmentId
An empty or whitespace-only input is discarded during construction and
will be stored as null.
$includeValue read-only
When true, the evaluated flag value will be attached to the `feature_flag` span event as the `feature_flag.result.value` attribute.
public
bool
$includeValue
$logger read-only
Optional PSR-3 logger used to report configuration issues encountered while constructing the options object (for example, an invalid environment ID). When `null`, no diagnostic output is produced.
public
LoggerInterface|null
$logger
Methods
__construct()
Construct an immutable options object.
public
__construct([bool $includeValue = false ][, bool $addSpans = false ][, string|null $environmentId = null ][, LoggerInterface|null $logger = null ]) : mixed
Parameters
- $includeValue : bool = false
-
When
true, the evaluated flag value will be serialized and attached to thefeature_flagspan event as thefeature_flag.result.valueattribute. Defaults tofalseto keep span cardinality and sensitive-data exposure opt-in. See self::$includeValue. - $addSpans : bool = false
-
Experimental. When
true, every variation call is additionally wrapped in anLDClient.<method>span. Defaults tofalse. See self::$addSpans. - $environmentId : string|null = null
-
Optional environment ID emitted as the
feature_flag.set.idattribute. Empty or whitespace-only inputs are rejected and stored asnull; a warning is logged when a$loggeris provided. See self::$environmentId. - $logger : LoggerInterface|null = null
-
Optional PSR-3 logger that receives construction-time warnings (for example, an invalid
$environmentId). Whennull, no diagnostic output is produced. See self::$logger.