Module: Datadog::Tracing::Contrib::Component
- Defined in:
- lib/datadog/tracing/contrib/component.rb
Overview
Initialization hooks for Contrib integrations
Class Method Summary collapse
-
.configure(config) ⇒ Object
Invoke all registered callbacks with the given configuration.
-
.register(name, &callback) {|config| ... } ⇒ Object
Register a callback to be invoked when components are reconfigured.
Class Method Details
.configure(config) ⇒ Object
Invoke all registered callbacks with the given configuration.
19 20 21 22 23 24 25 |
# File 'lib/datadog/tracing/contrib/component.rb', line 19 def configure(config) @registry.each do |name, callback| callback.call(config) rescue => e Datadog.logger.warn("Error configuring integration #{name}: #{e}") end end |
.register(name, &callback) {|config| ... } ⇒ Object
Register a callback to be invoked when components are reconfigured.
13 14 15 |
# File 'lib/datadog/tracing/contrib/component.rb', line 13 def register(name, &callback) @registry[name] = callback end |