tobox 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c424bc9f0cdf31194c16e9295a37eed99bc143867a08622f909b2605298f15c6
4
- data.tar.gz: 7076e13a73ec2b480f66c4be77354c6802fa52112590882ccb95bc284c1fd305
3
+ metadata.gz: 9e47d46ec5d5f20a122b8667f00227517002ea4503348a253e3e16cd6cabe281
4
+ data.tar.gz: 93fbcdbd7280e21249d4f798b7d86dac70cc8ff9847873d6a8368bda371ccf4d
5
5
  SHA512:
6
- metadata.gz: f806224e9cccddb59b1417e93343261aec881eff281fb112bc4a39ef7348215194d82c58596b88f89b052fe64bb492a65f2c560ee5ef218073d39d3f84bf4cc1
7
- data.tar.gz: 43a66e0d419eb193d1d0dff35c4e86c84da180bd24e7504e0ded248e283ba737492bf05101d8e13b2e5f232dab649865ee943f3263e1d4d7a4cd9d27813594b7
6
+ metadata.gz: bc3f385c64603c6a9b8f95f32e9c38d2974080b0df50a6530505c3d5438d3d60a3ecf66b06200beedce9de23838f0e6dbb6e2aca65233180107e362538905853
7
+ data.tar.gz: 5cb0d36a97a6bc173dfbfe01fc834a483848faf4157482b982551ffeb1eec3129dccd59b83cf65d9eab034c4560a7809699557a62dece8046f1944e55bcd9ee4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.6] - 2002-10-06
4
+
5
+ ### Bugfixes
6
+
7
+ Allow passing datadog options, initialize tracing from plugin.
8
+
3
9
  ## [0.1.5] - 2002-10-06
4
10
 
5
11
  ### Bugfixes
@@ -85,7 +85,7 @@ module Tobox
85
85
  self
86
86
  end
87
87
 
88
- def plugin(plugin, _options = nil, &block)
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
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "datadog/tracing/contrib"
3
4
  require "datadog/tracing/contrib/configuration/settings"
4
5
  require "datadog/tracing/span_operation"
5
6
 
@@ -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 :tobox, Datadog
104
+ register_plugin :datadog, Datadog
101
105
  end
102
106
  end
data/lib/tobox/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tobox
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tobox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - HoneyryderChuck