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 +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +8 -6
- data/instrument_all_the_things.gemspec +1 -0
- data/lib/instrument_all_the_things/instrumentors/error_logging.rb +7 -7
- data/lib/instrument_all_the_things/version.rb +1 -1
- metadata +1 -3
- data/vendor/cache/ddtrace-0.32.0.gem +0 -0
- data/vendor/cache/dogstatsd-ruby-4.6.0.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ebc1cc2c503e5b9bc3c354addd9e6e6a302e3166dbb733e2c4aeb7632b5a60d0
|
|
4
|
+
data.tar.gz: 24e05087f90516cd9cf48227e192725a0d371db8e49e1a55ebb8a904fe256b56
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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.
|
|
14
|
+
ddtrace (0.33.0)
|
|
15
15
|
msgpack
|
|
16
16
|
diff-lcs (1.3)
|
|
17
17
|
docile (1.3.2)
|
|
18
|
-
dogstatsd-ruby (4.
|
|
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
|
|
342
|
-
| -----------
|
|
343
|
-
|
|
|
344
|
-
| logger
|
|
345
|
-
| stat_reporter
|
|
346
|
-
| tracer
|
|
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
|
|
@@ -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
|
|
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
|
|
38
|
-
|
|
37
|
+
IATT.logger&.error <<~ERROR
|
|
38
|
+
An error occurred in #{context.trace_name(klass)}
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
#{e.message}
|
|
41
|
+
#{backtrace_cleaner.call(e.backtrace || []).join("\n")}
|
|
42
|
+
ERROR
|
|
43
43
|
|
|
44
44
|
raise
|
|
45
45
|
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.
|
|
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
|