rorvswild 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -4
- data/lib/rorvswild/agent.rb +12 -11
- data/lib/rorvswild/rails_loader.rb +3 -2
- data/lib/rorvswild/version.rb +1 -1
- data/lib/rorvswild.rb +4 -4
- 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: 34fc75a952dcdd5b7291e2227f2f59da531413338f0fb91ea64a61245b9368af
|
4
|
+
data.tar.gz: daab97444a9876ef871ca0c2832afd667cfb986fc1e101c36c97f3880f700b1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3986c7c35162a29f6f4173fa4ce6728fea1eac8d2c4293fc275f850b885fb0eb472c4a3be85a473761295322aa10c490f2ad1e4ae198b4528075033eb8c977db
|
7
|
+
data.tar.gz: 94ecd7c5f04ecbf7608f5fd37467ebfa5d49e8f6f5e50d2be4822d4cb695c65e15daa325c8843a2f04b6c841803040dfdb020e055bb961f6122101119e1e04df
|
data/README.md
CHANGED
@@ -155,12 +155,15 @@ From the configuration file, you can tell RorVsWild to skip monitoring some requ
|
|
155
155
|
production:
|
156
156
|
api_key: API_KEY
|
157
157
|
ignore_requests:
|
158
|
-
-
|
158
|
+
- HeartbeatController#show
|
159
|
+
- !ruby/regexp /SecretController/ # Ignore the entire controller
|
159
160
|
ignore_jobs:
|
160
161
|
- SecretJob
|
162
|
+
- !ruby/regexp /Secret::/ # Ignore the entire Secret namespace
|
161
163
|
ignore_exceptions:
|
162
164
|
- ActionController::RoutingError # Ignore by default any 404
|
163
165
|
- ZeroDivisionError
|
166
|
+
- !ruby/regexp /Secret::/ # Ignore all secret errors
|
164
167
|
ignore_plugins:
|
165
168
|
- Sidekiq # If you don't want to monitor your Sidekiq jobs
|
166
169
|
```
|
@@ -171,9 +174,9 @@ Here is the equivalent if you prefer initialising RorVsWild manually.
|
|
171
174
|
# config/initializers/rorvswild.rb
|
172
175
|
RorVsWild.start(
|
173
176
|
api_key: "API_KEY",
|
174
|
-
ignore_requests: ["
|
175
|
-
ignore_jobs: ["SecretJob"],
|
176
|
-
ignore_exceptions: ["ActionController::RoutingError", "ZeroDivisionError"],
|
177
|
+
ignore_requests: ["ApplicationController#heartbeat", /SecretController/],
|
178
|
+
ignore_jobs: ["SecretJob", /Secret::/],
|
179
|
+
ignore_exceptions: ["ActionController::RoutingError", "ZeroDivisionError", /Secret::/],
|
177
180
|
ignore_plugins: ["Sidekiq"])
|
178
181
|
```
|
179
182
|
|
data/lib/rorvswild/agent.rb
CHANGED
@@ -101,17 +101,17 @@ module RorVsWild
|
|
101
101
|
queue_request
|
102
102
|
end
|
103
103
|
|
104
|
-
def catch_error(
|
104
|
+
def catch_error(context = nil, &block)
|
105
105
|
begin
|
106
106
|
block.call
|
107
107
|
rescue Exception => ex
|
108
|
-
record_error(ex,
|
108
|
+
record_error(ex, context)
|
109
109
|
ex
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
-
def record_error(exception,
|
114
|
-
send_error(exception_to_hash(exception,
|
113
|
+
def record_error(exception, context = nil)
|
114
|
+
send_error(exception_to_hash(exception, context)) if !ignored_exception?(exception)
|
115
115
|
end
|
116
116
|
|
117
117
|
def push_exception(exception, options = nil)
|
@@ -148,11 +148,16 @@ module RorVsWild
|
|
148
148
|
end
|
149
149
|
|
150
150
|
def ignored_request?(name)
|
151
|
-
|
151
|
+
config[:ignore_requests].any? { |str_or_regex| str_or_regex === name }
|
152
152
|
end
|
153
153
|
|
154
154
|
def ignored_job?(name)
|
155
|
-
config[:ignore_jobs].
|
155
|
+
config[:ignore_jobs].any? { |str_or_regex| str_or_regex === name }
|
156
|
+
end
|
157
|
+
|
158
|
+
def ignored_exception?(exception)
|
159
|
+
return false unless config[:ignore_exceptions]
|
160
|
+
config[:ignore_exceptions].any? { |str_or_regex| str_or_regex === exception.class.to_s }
|
156
161
|
end
|
157
162
|
|
158
163
|
def send_deployment
|
@@ -201,13 +206,9 @@ module RorVsWild
|
|
201
206
|
message: exception.message,
|
202
207
|
backtrace: exception.backtrace || ["No backtrace"],
|
203
208
|
exception: exception.class.to_s,
|
204
|
-
|
209
|
+
context: context,
|
205
210
|
environment: Host.to_h,
|
206
211
|
}
|
207
212
|
end
|
208
|
-
|
209
|
-
def ignored_exception?(exception)
|
210
|
-
(config[:ignored_exceptions] || config[:ignore_exceptions]).include?(exception.class.to_s)
|
211
|
-
end
|
212
213
|
end
|
213
214
|
end
|
@@ -20,8 +20,9 @@ module RorVsWild
|
|
20
20
|
|
21
21
|
def self.load_config
|
22
22
|
if (path = Rails.root.join("config/rorvswild.yml")).exist?
|
23
|
-
|
24
|
-
hash
|
23
|
+
yaml = ERB.new(path.read).result
|
24
|
+
hash = YAML.safe_load(yaml, permitted_classes: [Regexp])
|
25
|
+
hash[Rails.env] && hash[Rails.env].deep_symbolize_keys
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|
data/lib/rorvswild/version.rb
CHANGED
data/lib/rorvswild.rb
CHANGED
@@ -38,12 +38,12 @@ module RorVsWild
|
|
38
38
|
agent ? agent.measure_block(name , &block) : block.call
|
39
39
|
end
|
40
40
|
|
41
|
-
def self.catch_error(
|
42
|
-
agent ? agent.catch_error(
|
41
|
+
def self.catch_error(context = nil, &block)
|
42
|
+
agent ? agent.catch_error(context, &block) : block.call
|
43
43
|
end
|
44
44
|
|
45
|
-
def self.record_error(exception,
|
46
|
-
agent.record_error(exception,
|
45
|
+
def self.record_error(exception, context = nil)
|
46
|
+
agent.record_error(exception, context) if agent
|
47
47
|
end
|
48
48
|
|
49
49
|
def self.merge_error_context(hash)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rorvswild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Bernard
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-02-
|
12
|
+
date: 2023-02-23 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Performances and errors insights for rails developers.
|
15
15
|
email:
|