Class: LaunchDarkly::Otel::TracingHookOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-otel/tracing_hook.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ TracingHookOptions

Configuration options to control the effect of the TracingHook.

Parameters:

  • opts (Hash) (defaults to: {})

    the configuration options

Options Hash (opts):



43
44
45
46
47
# File 'lib/ldclient-otel/tracing_hook.rb', line 43

def initialize(opts = {})
  @add_spans = opts.fetch(:add_spans, nil)
  @include_variant = opts.fetch(:include_variant, false)
  @logger = opts[:logger] || LaunchDarkly::Otel.default_logger
end

Instance Attribute Details

#add_spansBoolean? (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.

Returns:

  • (Boolean, nil)


17
18
19
# File 'lib/ldclient-otel/tracing_hook.rb', line 17

def add_spans
  @add_spans
end

#include_variantBoolean (readonly)

If set to true, then the tracing hook will add the evaluated flag value to span events.

The default is false.

Returns:

  • (Boolean)


26
27
28
# File 'lib/ldclient-otel/tracing_hook.rb', line 26

def include_variant
  @include_variant
end

#loggerLogger (readonly)

The logger used for hook execution. Provide a custom logger or use the default which logs to the console.

Returns:

  • (Logger)


33
34
35
# File 'lib/ldclient-otel/tracing_hook.rb', line 33

def logger
  @logger
end