tobox 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/tobox/configuration.rb +3 -3
- data/lib/tobox/plugins/datadog/configuration.rb +1 -0
- data/lib/tobox/plugins/datadog.rb +6 -2
- data/lib/tobox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e47d46ec5d5f20a122b8667f00227517002ea4503348a253e3e16cd6cabe281
|
4
|
+
data.tar.gz: 93fbcdbd7280e21249d4f798b7d86dac70cc8ff9847873d6a8368bda371ccf4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc3f385c64603c6a9b8f95f32e9c38d2974080b0df50a6530505c3d5438d3d60a3ecf66b06200beedce9de23838f0e6dbb6e2aca65233180107e362538905853
|
7
|
+
data.tar.gz: 5cb0d36a97a6bc173dfbfe01fc834a483848faf4157482b982551ffeb1eec3129dccd59b83cf65d9eab034c4560a7809699557a62dece8046f1944e55bcd9ee4
|
data/CHANGELOG.md
CHANGED
data/lib/tobox/configuration.rb
CHANGED
@@ -85,7 +85,7 @@ module Tobox
|
|
85
85
|
self
|
86
86
|
end
|
87
87
|
|
88
|
-
def plugin(plugin,
|
88
|
+
def plugin(plugin, **options, &block)
|
89
89
|
raise Error, "Cannot add a plugin to a frozen config" if frozen?
|
90
90
|
|
91
91
|
plugin = Plugins.load_plugin(plugin) if plugin.is_a?(Symbol)
|
@@ -93,11 +93,11 @@ module Tobox
|
|
93
93
|
return if @plugins.include?(plugin)
|
94
94
|
|
95
95
|
@plugins << plugin
|
96
|
-
plugin.load_dependencies(self, &block) if plugin.respond_to?(:load_dependencies)
|
96
|
+
plugin.load_dependencies(self, **options, &block) if plugin.respond_to?(:load_dependencies)
|
97
97
|
|
98
98
|
extend(plugin::ConfigurationMethods) if defined?(plugin::ConfigurationMethods)
|
99
99
|
|
100
|
-
plugin.configure(self, &block) if plugin.respond_to?(:configure)
|
100
|
+
plugin.configure(self, **options, &block) if plugin.respond_to?(:configure)
|
101
101
|
end
|
102
102
|
|
103
103
|
def freeze
|
@@ -88,15 +88,19 @@ module Tobox
|
|
88
88
|
require "uri"
|
89
89
|
end
|
90
90
|
|
91
|
-
def configure(config)
|
91
|
+
def configure(config, **datadog_options, &blk)
|
92
92
|
event_handler = EventHandler.new(config)
|
93
93
|
config.on_before_event(&event_handler.method(:on_start))
|
94
94
|
config.on_after_event(&event_handler.method(:on_finish))
|
95
95
|
config.on_error_event(&event_handler.method(:on_error))
|
96
|
+
::Datadog.configure do |c|
|
97
|
+
c.tracing.instrument :tobox, datadog_options
|
98
|
+
yield(c) if blk
|
99
|
+
end
|
96
100
|
end
|
97
101
|
end
|
98
102
|
end
|
99
103
|
|
100
|
-
register_plugin :
|
104
|
+
register_plugin :datadog, Datadog
|
101
105
|
end
|
102
106
|
end
|
data/lib/tobox/version.rb
CHANGED