instrument_all_the_things 0.9.0.alpha → 0.9.1.alpha

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13757eb83b8ab7dfb82354e91666927cac3cb03027dc52e67604c1de51b4f748
4
- data.tar.gz: e69d10d504e0a017074c4cfb208fe2775508f1adb29c88d9e47e265badcfe0ec
3
+ metadata.gz: ebc1cc2c503e5b9bc3c354addd9e6e6a302e3166dbb733e2c4aeb7632b5a60d0
4
+ data.tar.gz: 24e05087f90516cd9cf48227e192725a0d371db8e49e1a55ebb8a904fe256b56
5
5
  SHA512:
6
- metadata.gz: 5743da7853d6563314b209954a090eca836aff00b908392678df98abad8bb62c1fc6fdcf6f64abd5be715781c5281fdcd7f470b40471217e005f16e12dc2ccec
7
- data.tar.gz: b087b4ef6a124e395023372bc4211e790fe31869e319f6aa491abe1396e282e1c427dd7382dc1479f23ab88f4eb3122d647fb085527cdc80036c6f0904b93e9a
6
+ metadata.gz: f0a4e4d5badd480935a98af973dc34d860e113a069670cb6a84b06df1410ce34bccacdcd89dded8e01433ff797625abf7b5157cf473b2700a5782eadf8a8588c
7
+ data.tar.gz: 8a90c7b66cd5bfbc7e992d8532f4cff349658e70cd7aeaa858cedfe023fccf7abfa8803eda3bd78bc69ee45bd7f6ad45a1d9e9ac7ff1b42ecc2e0097fec231d2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- instrument_all_the_things (0.9.0.alpha)
4
+ instrument_all_the_things (0.9.1.alpha)
5
5
  ddtrace
6
6
  dogstatsd-ruby
7
7
 
@@ -11,11 +11,11 @@ GEM
11
11
  ast (2.4.0)
12
12
  benchmark-ips (2.7.2)
13
13
  coderay (1.1.2)
14
- ddtrace (0.32.0)
14
+ ddtrace (0.33.0)
15
15
  msgpack
16
16
  diff-lcs (1.3)
17
17
  docile (1.3.2)
18
- dogstatsd-ruby (4.6.0)
18
+ dogstatsd-ruby (4.7.0)
19
19
  jaro_winkler (1.5.4)
20
20
  method_source (0.9.2)
21
21
  msgpack (1.3.3)
data/README.md CHANGED
@@ -100,6 +100,7 @@ You can setup your test environment by running the following setup:
100
100
  ```ruby
101
101
  require 'instrument_all_the_things/testing/stat_tracker'
102
102
  require 'instrument_all_the_things/testing/trace_tracker'
103
+ require 'instrument_all_the_things/testing/rspec_matchers'
103
104
 
104
105
  Datadog.configure do |c|
105
106
  c.tracer transport_options: proc { |t|
@@ -110,6 +111,7 @@ end
110
111
  IATT.stat_reporter = IATT::Testing::StatTracker.new
111
112
 
112
113
  RSpec.configure do |config|
114
+ config.include InstrumentAllTheThings::Testing::RSpecMatchers
113
115
  config.before(:each) do
114
116
  IATT::Testing::TraceTracker.tracker.reset!
115
117
  IATT.stat_reporter.reset!
@@ -338,12 +340,12 @@ please open some PRs!
338
340
  ## Configuration
339
341
  The configuration for IATT is available on the top level InstrumentAllTheThings module.
340
342
 
341
- | Config Name | Description | Default
342
- | ----------- | ----------- | -------
343
- | stat_prefix | The string to add to all outbound stats (may not be changed after stat transmiter initialization) | `nil`
344
- | logger | The logger used to report errors and info | If the constant `Rails` is set, use `Rails.logger`. <br>If `App` and it responds to `logger` use `App.logger`. Otherwise create a new `Logger` sent to STDOUT
345
- | stat_reporter | The class which receives simple stats | If [Datadog::Statsd](https://github.com/DataDog/dogstatsd-ruby) is found, use that, otherwise the Blackhole client is used
346
- | tracer | The instance of a tracer which will handle all traces | If `Datadog` is defined and responds to `tracer`, use the value returned by that. Otherwise use the Blackhole. [Gem](https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md)
343
+ | Config Name | Description | Default
344
+ | ----------- | ----------- | -------
345
+ | stat_namespace | The string to add to all outbound stats (may not be changed after stat transmiter initialization) | `nil`
346
+ | logger | The logger used to report errors and info | If the constant `Rails` is set, use `Rails.logger`. <br>If `App` and it responds to `logger` use `App.logger`. Otherwise create a new `Logger` sent to STDOUT
347
+ | stat_reporter | The class which receives simple stats | If [Datadog::Statsd](https://github.com/DataDog/dogstatsd-ruby) is found, use that, otherwise the Blackhole client is used
348
+ | tracer | The instance of a tracer which will handle all traces | If `Datadog` is defined and responds to `tracer`, use the value returned by that. Otherwise use the Blackhole. [Gem](https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md)
347
349
 
348
350
 
349
351
  ### Stats Reporters
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'pry'
3
4
  lib = File.expand_path('lib', __dir__)
4
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
6
  require 'instrument_all_the_things/version'
@@ -20,9 +20,9 @@ module InstrumentAllTheThings
20
20
  DEFAULT_ERROR_LOGGING_OPTIONS.merge(opts)
21
21
  end
22
22
 
23
- backtrace_cleaner = if opts[:exclude_bundle_path ] && defined?(Bundler)
23
+ backtrace_cleaner = if opts[:exclude_bundle_path] && defined?(Bundler)
24
24
  bundle_path = Bundler.bundle_path.to_s
25
- ->(trace) { trace.reject{|p| p.start_with?(bundle_path)} }
25
+ ->(trace) { trace.reject { |p| p.start_with?(bundle_path) } }
26
26
  else
27
27
  ->(trace) { trace }
28
28
  end
@@ -34,12 +34,12 @@ module InstrumentAllTheThings
34
34
 
35
35
  e.instance_variable_set(:@_logged_by_iatt, true)
36
36
 
37
- IATT.logger&.error("An error occurred in #{context.trace_name(klass)}")
38
- IATT.logger&.error(e.message)
37
+ IATT.logger&.error <<~ERROR
38
+ An error occurred in #{context.trace_name(klass)}
39
39
 
40
- callstack = backtrace_cleaner.call(e.backtrace || [])
41
-
42
- IATT.logger&.error(callstack.join("\n"))
40
+ #{e.message}
41
+ #{backtrace_cleaner.call(e.backtrace || []).join("\n")}
42
+ ERROR
43
43
 
44
44
  raise
45
45
  end
@@ -1,3 +1,3 @@
1
1
  module InstrumentAllTheThings
2
- VERSION = "0.9.0.alpha"
2
+ VERSION = "0.9.1.alpha"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instrument_all_the_things
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0.alpha
4
+ version: 0.9.1.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Malinconico
@@ -176,10 +176,8 @@ files:
176
176
  - vendor/cache/ast-2.4.0.gem
177
177
  - vendor/cache/benchmark-ips-2.7.2.gem
178
178
  - vendor/cache/coderay-1.1.2.gem
179
- - vendor/cache/ddtrace-0.32.0.gem
180
179
  - vendor/cache/diff-lcs-1.3.gem
181
180
  - vendor/cache/docile-1.3.2.gem
182
- - vendor/cache/dogstatsd-ruby-4.6.0.gem
183
181
  - vendor/cache/jaro_winkler-1.5.4.gem
184
182
  - vendor/cache/method_source-0.9.2.gem
185
183
  - vendor/cache/msgpack-1.3.3.gem
Binary file
Binary file