airbrake-ruby 4.13.2 → 4.13.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/airbrake-ruby.rb +1 -0
- data/lib/airbrake-ruby/filters/keys_filter.rb +12 -1
- data/lib/airbrake-ruby/stat.rb +15 -10
- data/lib/airbrake-ruby/version.rb +1 -1
- data/spec/airbrake_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63e544ab7354b30c5a8f4e3e73ba22daf9f27a0e3d4804e3bf015f38b34a6314
|
4
|
+
data.tar.gz: f2d238127b26e3fdfdc1b7848f847760993a87d15182ec7266e42d7db753609c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 759ab3e188a8c20f2363e6aabdda6634f278b87cf24a67ecaad3998dde0dfe9de856ad8ca44f6a068b22afc2f8dcd7408ab66be6010ec3090cd2b52eef4434d8
|
7
|
+
data.tar.gz: 845c5c487af401362663273c85d56fb924578332a227ba534ced253d954af17ebdade9c6d5346a8e9640fcb4c8583ad068c8c43d0bc85fa7ec41298aff07c978
|
data/lib/airbrake-ruby.rb
CHANGED
@@ -24,7 +24,18 @@ module Airbrake
|
|
24
24
|
|
25
25
|
# @return [Array<Symbol>] parts of a Notice's *context* payload that can
|
26
26
|
# be modified by blacklist/whitelist filters
|
27
|
-
FILTERABLE_CONTEXT_KEYS = %i[
|
27
|
+
FILTERABLE_CONTEXT_KEYS = %i[
|
28
|
+
user
|
29
|
+
|
30
|
+
# Provided by Airbrake::Rack::HttpHeadersFilter
|
31
|
+
headers
|
32
|
+
referer
|
33
|
+
httpMethod
|
34
|
+
|
35
|
+
# Provided by Airbrake::Rack::ContextFilter
|
36
|
+
userAddr
|
37
|
+
userAgent
|
38
|
+
].freeze
|
28
39
|
|
29
40
|
include Loggable
|
30
41
|
|
data/lib/airbrake-ruby/stat.rb
CHANGED
@@ -24,18 +24,21 @@ module Airbrake
|
|
24
24
|
@sum = sum
|
25
25
|
@sumsq = sumsq
|
26
26
|
@tdigest = tdigest
|
27
|
+
@mutex = Mutex.new
|
27
28
|
end
|
28
29
|
|
29
30
|
# @return [Hash{String=>Object}] stats as a hash with compressed TDigest
|
30
31
|
# (serialized as base64)
|
31
32
|
def to_h
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
@mutex.synchronize do
|
34
|
+
tdigest.compress!
|
35
|
+
{
|
36
|
+
'count' => tdigest.size,
|
37
|
+
'sum' => sum,
|
38
|
+
'sumsq' => sumsq,
|
39
|
+
'tdigest' => Base64.strict_encode64(tdigest.as_small_bytes),
|
40
|
+
}
|
41
|
+
end
|
39
42
|
end
|
40
43
|
|
41
44
|
# Increments tdigest timings and updates tdigest with the difference between
|
@@ -54,10 +57,12 @@ module Airbrake
|
|
54
57
|
# @param [Float] ms
|
55
58
|
# @return [void]
|
56
59
|
def increment_ms(ms)
|
57
|
-
|
58
|
-
|
60
|
+
@mutex.synchronize do
|
61
|
+
self.sum += ms
|
62
|
+
self.sumsq += ms * ms
|
59
63
|
|
60
|
-
|
64
|
+
tdigest.push(ms)
|
65
|
+
end
|
61
66
|
end
|
62
67
|
|
63
68
|
# We define custom inspect so that we weed out uninformative TDigest, which
|
data/spec/airbrake_spec.rb
CHANGED
@@ -75,6 +75,16 @@ RSpec.describe Airbrake do
|
|
75
75
|
described_class.configure {}
|
76
76
|
expect(described_class.deploy_notifier).to eql(deploy_notifier)
|
77
77
|
end
|
78
|
+
|
79
|
+
it "doesn't append the same notice notifier filters over and over" do
|
80
|
+
described_class.configure do |c|
|
81
|
+
c.project_id = 1
|
82
|
+
c.project_key = '2'
|
83
|
+
end
|
84
|
+
|
85
|
+
expect(described_class.notice_notifier).not_to receive(:add_filter)
|
86
|
+
10.times { described_class.configure {} }
|
87
|
+
end
|
78
88
|
end
|
79
89
|
|
80
90
|
context "when blacklist_keys gets configured" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airbrake-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.13.
|
4
|
+
version: 4.13.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airbrake Technologies, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02
|
11
|
+
date: 2020-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rbtree3
|