failbot 1.1.4 → 1.1.5
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/lib/failbot.rb +19 -3
- data/lib/failbot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90628071f00b062ad9f21fae9244d905c2f38ceb
|
4
|
+
data.tar.gz: d54bf144087e7a9bac861e838faa7e64ccc7deb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 851ec7c6a661593e9edc3ffee53799c3ceab8cde34c14a0109f8ecbdb84e95f38a304600f1671d9b2a720ccf2e09a8857d75426bff3d5197fd9d5b71182f2759
|
7
|
+
data.tar.gz: f47a0e5f9f083b44380f76818392e8e98bc61fc19d7871c71d205c0e92006598b3283c58ab868c243b41efc858e2fb620d566a046f177d14497b76223deeaf35
|
data/lib/failbot.rb
CHANGED
@@ -251,8 +251,8 @@ module Failbot
|
|
251
251
|
# e - The exception object to turn into a Hash.
|
252
252
|
#
|
253
253
|
# Returns a Hash including a 'class', 'message', 'backtrace', and 'rollup'
|
254
|
-
# keys. The rollup value is
|
255
|
-
#
|
254
|
+
# keys. The rollup value is an MD5 hash of the exception class and the
|
255
|
+
# raising file, line, and method.
|
256
256
|
def exception_info(e)
|
257
257
|
backtrace = Array(e.backtrace)[0, 500]
|
258
258
|
|
@@ -261,7 +261,7 @@ module Failbot
|
|
261
261
|
'message' => e.message,
|
262
262
|
'backtrace' => backtrace.join("\n"),
|
263
263
|
'ruby' => RUBY_DESCRIPTION,
|
264
|
-
'rollup' =>
|
264
|
+
'rollup' => rollup(e),
|
265
265
|
'created_at' => Time.now.utc.iso8601(6)
|
266
266
|
}
|
267
267
|
|
@@ -300,6 +300,22 @@ module Failbot
|
|
300
300
|
Failbot.instrumenter.instrument(name, payload) if Failbot.instrumenter
|
301
301
|
end
|
302
302
|
|
303
|
+
# Generate a rollup for an exception. Exceptions with the same rollup are
|
304
|
+
# grouped together in Haystack. The rollup is an MD5 hash of the exception
|
305
|
+
# class and the raising file, line, and method.
|
306
|
+
#
|
307
|
+
# e - The exception object
|
308
|
+
#
|
309
|
+
# Returns a String.
|
310
|
+
def rollup(e)
|
311
|
+
backtrace_line = Array(e.backtrace).first || ""
|
312
|
+
# We want all exceptions from foo.html.erb:123 to be grouped together, no
|
313
|
+
# matter what wacky generated ERB method name is attached to it.
|
314
|
+
cleaned_line = backtrace_line.sub(/_erb__[_\d]+'\z/, "_erb'")
|
315
|
+
|
316
|
+
Digest::MD5.hexdigest("#{e.class}#{cleaned_line}")
|
317
|
+
end
|
318
|
+
|
303
319
|
extend self
|
304
320
|
|
305
321
|
# If the library was lazy loaded due to failbot/exit_hook.rb and a delayed
|
data/lib/failbot/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: failbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "@rtomayko"
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-05-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: yajl-ruby
|