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):



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_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

#environment_idString? (readonly)

Optional environment ID to include as feature_flag.set.id attribute.

Returns:

  • (String, nil)


40
41
42
# File 'lib/ldclient-otel/tracing_hook.rb', line 40

def environment_id
  @environment_id
end

#include_valueBoolean (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_value
  @include_value
end

#include_variantBoolean (readonly)

Deprecated: Use include_value instead.

Returns:

  • (Boolean)


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

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)


47
48
49
# File 'lib/ldclient-otel/tracing_hook.rb', line 47

def logger
  @logger
end