Class: NewRelic::TelemetrySdk::Configurator
- Inherits:
-
Object
- Object
- NewRelic::TelemetrySdk::Configurator
- Defined in:
- lib/newrelic/telemetry_sdk/configurator.rb
Overview
The Configurator provides the mechanism through which the SDK is configured.
See Config for details on what properties can be configured.
Class Method Summary collapse
- .config ⇒ Object
-
.reset ⇒ Object
private
Removes any configurations that were previously customized, effectively resetting the Config state to defaults.
Instance Method Summary collapse
-
#config ⇒ Object
Allows direct access to the config state.
-
#configure ⇒ Object
Set Telemetry SDK configuration with a block.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (private)
Delegates any setter methods to the Config object if it responds to such. All other missing methods are propagated up the chain.
59 60 61 62 63 64 65 |
# File 'lib/newrelic/telemetry_sdk/configurator.rb', line 59 def method_missing method, *args, &block if method.to_s =~ /\=$/ && config.respond_to?(method) config.send method, *args, &block else super end end |
Class Method Details
.config ⇒ Object
19 20 21 |
# File 'lib/newrelic/telemetry_sdk/configurator.rb', line 19 def self.config @config ||= Config.new end |
.reset ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Removes any configurations that were previously customized, effectively resetting the NewRelic::TelemetrySdk::Config state to defaults
27 28 29 |
# File 'lib/newrelic/telemetry_sdk/configurator.rb', line 27 def self.reset @config = nil end |
Instance Method Details
#config ⇒ Object
Unlike configuring with # NewRelic::TelemetrySdk::Configurator#self#self.configure, setting config properties here may, or may not become immediately active. Use with care.
Allows direct access to the config state. The primary purpose of this method is to access config properties throughout the SDK.
38 39 40 |
# File 'lib/newrelic/telemetry_sdk/configurator.rb', line 38 def config Configurator.config end |
#configure ⇒ Object
Set Telemetry SDK configuration with a block. See NewRelic::TelemetrySdk::Config for options.
51 52 53 |
# File 'lib/newrelic/telemetry_sdk/configurator.rb', line 51 def configure Logger.logger = config.logger end |