Class: LaunchDarkly::Otel::TracingHookOptions
- Inherits:
-
Object
- Object
- LaunchDarkly::Otel::TracingHookOptions
- Defined in:
- lib/ldclient-otel/tracing_hook.rb
Instance Attribute Summary collapse
-
#add_spans ⇒ Boolean?
readonly
Experimental: If set to true, then the tracing hook will add spans for each variation method call.
-
#environment_id ⇒ String?
readonly
Optional environment ID to include as feature_flag.set.id attribute.
-
#include_value ⇒ Boolean
readonly
If set to true, then the tracing hook will add the evaluated flag value to span events.
-
#include_variant ⇒ Boolean
readonly
Deprecated: Use include_value instead.
-
#logger ⇒ Logger
readonly
The logger used for hook execution.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ TracingHookOptions
constructor
Configuration options to control the effect of the TracingHook.
Constructor Details
#initialize(opts = {}) ⇒ TracingHookOptions
Configuration options to control the effect of the TracingHook.
59 60 61 62 63 64 65 |
# File 'lib/ldclient-otel/tracing_hook.rb', line 59 def initialize(opts = {}) @add_spans = opts.fetch(:add_spans, nil) @include_value = opts.fetch(:include_value, opts.fetch(:include_variant, false)) @include_variant = opts.fetch(:include_variant, false) @logger = opts[:logger] || LaunchDarkly::Otel.default_logger @environment_id = validate_environment_id(opts[:environment_id]) end |
Instance Attribute Details
#add_spans ⇒ Boolean? (readonly)
Experimental: If set to true, then the tracing hook will add spans for each variation method call. Span events are always added and are unaffected by this setting.
The default value is false.
This feature is experimental and the data in the spans, or nesting of spans, could change in future versions.
17 18 19 |
# File 'lib/ldclient-otel/tracing_hook.rb', line 17 def add_spans @add_spans end |
#environment_id ⇒ String? (readonly)
Optional environment ID to include as feature_flag.set.id attribute.
40 41 42 |
# File 'lib/ldclient-otel/tracing_hook.rb', line 40 def environment_id @environment_id end |
#include_value ⇒ Boolean (readonly)
If set to true, then the tracing hook will add the evaluated flag value to span events.
The default is false.
26 27 28 |
# File 'lib/ldclient-otel/tracing_hook.rb', line 26 def include_value @include_value end |
#include_variant ⇒ Boolean (readonly)
Deprecated: Use include_value instead.
33 34 35 |
# File 'lib/ldclient-otel/tracing_hook.rb', line 33 def include_variant @include_variant end |
#logger ⇒ Logger (readonly)
The logger used for hook execution. Provide a custom logger or use the default which logs to the console.
47 48 49 |
# File 'lib/ldclient-otel/tracing_hook.rb', line 47 def logger @logger end |