sentry-raven 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/raven/base.rb +1 -0
- data/lib/raven/configuration.rb +5 -0
- data/lib/raven/integrations/delayed_job.rb +2 -2
- data/lib/raven/processor/truncator.rb +22 -0
- data/lib/raven/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc76647e919f5e837ef8abf2cbf0521e11193220
|
4
|
+
data.tar.gz: 978b72587b050a72524c5f6c559d2a88a8aaa74f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c001fe837c066e6c31798f2559848b136bfc5b06a305d7760935114a9efb88d8dc6997b421d0d09ac7e97069bccc7112592c724c2b1bd3b946f29ff4536d9e2
|
7
|
+
data.tar.gz: 01cd432010f844dacca7fb3fdface7e4421e528e0efcf56bc3d9ee566a2ebfd9e2840e293a3cb493675d8179ff66795ccb2c5c9a84c5f6a9b6a2cd8b3e2a6c55
|
data/lib/raven/base.rb
CHANGED
@@ -7,6 +7,7 @@ require 'raven/processor/removecircularreferences'
|
|
7
7
|
require 'raven/processor/utf8conversion'
|
8
8
|
require 'raven/processor/cookies'
|
9
9
|
require 'raven/processor/post_data'
|
10
|
+
require 'raven/processor/truncator'
|
10
11
|
require 'raven/configuration'
|
11
12
|
require 'raven/context'
|
12
13
|
require 'raven/client'
|
data/lib/raven/configuration.rb
CHANGED
@@ -112,6 +112,9 @@ module Raven
|
|
112
112
|
# Sanitize values that look like credit card numbers
|
113
113
|
attr_accessor :sanitize_credit_cards
|
114
114
|
|
115
|
+
# Truncate any strings longer than this bytesize before sending
|
116
|
+
attr_accessor :event_bytesize_limit
|
117
|
+
|
115
118
|
# Logger 'progname's to exclude from breadcrumbs
|
116
119
|
attr_accessor :exclude_loggers
|
117
120
|
|
@@ -127,6 +130,7 @@ module Raven
|
|
127
130
|
].freeze
|
128
131
|
|
129
132
|
DEFAULT_PROCESSORS = [
|
133
|
+
Raven::Processor::Truncator,
|
130
134
|
Raven::Processor::RemoveCircularReferences,
|
131
135
|
Raven::Processor::UTF8Conversion,
|
132
136
|
Raven::Processor::SanitizeData,
|
@@ -153,6 +157,7 @@ module Raven
|
|
153
157
|
self.transport_failure_callback = false
|
154
158
|
self.sanitize_fields = []
|
155
159
|
self.sanitize_credit_cards = true
|
160
|
+
self.event_bytesize_limit = 8_000
|
156
161
|
self.environments = []
|
157
162
|
self.exclude_loggers = []
|
158
163
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Raven
|
2
|
+
class Processor::Truncator < Processor
|
3
|
+
attr_accessor :event_bytesize_limit
|
4
|
+
|
5
|
+
def initialize(client)
|
6
|
+
super
|
7
|
+
self.event_bytesize_limit = client.configuration.event_bytesize_limit
|
8
|
+
end
|
9
|
+
|
10
|
+
def process(value)
|
11
|
+
value.each_with_object(value) { |(k, v), memo| memo[k] = truncate(v) }
|
12
|
+
end
|
13
|
+
|
14
|
+
def truncate(v)
|
15
|
+
if v.respond_to?(:bytesize) && v.bytesize >= event_bytesize_limit
|
16
|
+
v.byteslice(0...event_bytesize_limit)
|
17
|
+
else
|
18
|
+
v
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/raven/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-raven
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -162,6 +162,7 @@ files:
|
|
162
162
|
- lib/raven/processor/removecircularreferences.rb
|
163
163
|
- lib/raven/processor/removestacktrace.rb
|
164
164
|
- lib/raven/processor/sanitizedata.rb
|
165
|
+
- lib/raven/processor/truncator.rb
|
165
166
|
- lib/raven/processor/utf8conversion.rb
|
166
167
|
- lib/raven/transports.rb
|
167
168
|
- lib/raven/transports/dummy.rb
|