Method: OpenTelemetry::SDK::Configurator#use

Defined in:
lib/opentelemetry/sdk/configurator.rb

#use(instrumentation_name, config = nil) ⇒ Object

Install an instrumentation with specified optional +config+. Use can be called multiple times to install multiple instrumentation. Only +use+ or +use_all+, but not both when installing instrumentation. A call to +use_all+ after +use+ will result in an exception.

Parameters:

  • instrumentation_name (String)

    The name of the instrumentation

  • config (optional Hash) (defaults to: nil)

    The config for this instrumentation



101
102
103
104
105
# File 'lib/opentelemetry/sdk/configurator.rb', line 101

def use(instrumentation_name, config = nil)
  check_use_mode!(USE_MODE_ONE)
  @instrumentation_names << instrumentation_name
  @instrumentation_config_map[instrumentation_name] = config if config
end