raygun-apm-rails 1.0.17 → 1.0.18
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/CHANGELOG.rdoc +10 -0
- data/lib/raygun/apm/rails.rb +6 -0
- data/lib/raygun/apm/rails/middleware.rb +21 -13
- data/lib/raygun/apm/rails/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 715626f8f9976fa6af04de7e06b2977e1dc261f48e50e27b01edd4772af08be9
|
4
|
+
data.tar.gz: a25c402d9238165a0664047bfe15a5074e3c4c7088ccb28af2fddb5cdacc09b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d86b7b853a306a61b9993f417abce9a861b2c41ac2a68129e003b2e4d9f5e7cd90d1dfb4027bd1ceee5ed9cc2df98ef652e9abf98045cd13169cc95061dcb28
|
7
|
+
data.tar.gz: 610ff0610f8b9176fa747b97c9bf6e6db312c8fc9df06e4e87cd55e94c16939a9e6c11d4889a3c0561984e4dd90ae565b48e98a636a9da9fcef912d06565e55e
|
data/CHANGELOG.rdoc
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
= Changelog
|
2
|
+
|
3
|
+
== 1.0.18 (March 15, 2020)
|
4
|
+
|
5
|
+
* Ensure a better experience with raygun4ruby with only Raygun::track_exception whitelisted
|
6
|
+
* Remove the warning on a HTTP IN event with an exception payload - spams STDOUT and already confused some testers
|
7
|
+
* Ensure errors raised during request exception always result in a fully wrapped trace with a 500 status
|
8
|
+
* Wrap the exceptional HTTP IN error handler in a fake user code method too to get past the agent gate for that
|
9
|
+
* Prefer the singleton interface on the Tracer
|
10
|
+
* Blacklist HTTParty
|
data/lib/raygun/apm/rails.rb
CHANGED
@@ -67,7 +67,13 @@ module Raygun
|
|
67
67
|
Nokogiri
|
68
68
|
Loofah
|
69
69
|
WebConsole
|
70
|
+
HTTParty
|
71
|
+
Raygun::Breadcrumbs
|
72
|
+
Raygun::Configuration
|
73
|
+
Raygun::config
|
70
74
|
+Raygun::Apm::Rails::Middleware::Ruby_APM_profiler_trace
|
75
|
+
+Raygun::Apm::Rails::Middleware::Ruby_APM_request_error
|
76
|
+
+Raygun::track_exception
|
71
77
|
}
|
72
78
|
end
|
73
79
|
end
|
@@ -17,16 +17,23 @@ module Raygun
|
|
17
17
|
def instrument(env)
|
18
18
|
res = nil
|
19
19
|
# Can be nil if we had a fatal error
|
20
|
-
@tracer ||= init_tracer
|
20
|
+
@tracer ||= Raygun::Apm::Tracer.instance || init_tracer
|
21
21
|
if @tracer
|
22
22
|
# For the exceptional HTTP IN handler
|
23
23
|
@request_started = @tracer.now
|
24
|
-
Thread.current.thread_variable_set(:_raygun_apm_tracer, @tracer)
|
25
24
|
@tracer.start_trace
|
26
25
|
end
|
27
|
-
|
26
|
+
exception = nil
|
27
|
+
res = nil
|
28
|
+
Ruby_APM_profiler_trace do
|
29
|
+
begin
|
30
|
+
res = @app.call(env)
|
31
|
+
rescue
|
32
|
+
exceptional_http_in_handler(env, 500)
|
33
|
+
end
|
34
|
+
end
|
28
35
|
if (status = res.first) >= 400 && status < 600
|
29
|
-
exceptional_http_in_handler(env, status)
|
36
|
+
Ruby_APM_request_error { exceptional_http_in_handler(env, status) }
|
30
37
|
end
|
31
38
|
# Can be nil if we had a fatal error
|
32
39
|
@tracer.end_trace if @tracer
|
@@ -36,11 +43,10 @@ module Raygun
|
|
36
43
|
end
|
37
44
|
|
38
45
|
def init_tracer
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
ObjectSpace.define_finalizer(self, self.class.finalize(@tracer))
|
46
|
+
tracer = Raygun::Apm::Tracer.new
|
47
|
+
tracer.udp_sink!
|
48
|
+
tracer.process_started
|
49
|
+
ObjectSpace.define_finalizer(self, self.class.finalize(tracer))
|
44
50
|
|
45
51
|
@http_in_subscriber = ActiveSupport::Notifications.subscribe('process_action.action_controller') do |*args|
|
46
52
|
http_in_handler(args)
|
@@ -51,7 +57,7 @@ module Raygun
|
|
51
57
|
end
|
52
58
|
|
53
59
|
GC.stress = true if ENV['RAYGUN_STRESS_GC']
|
54
|
-
|
60
|
+
Raygun::Apm::Tracer.instance = tracer
|
55
61
|
# If any fatal errors on init, shutdown the tracer
|
56
62
|
rescue Raygun::Apm::FatalError => e
|
57
63
|
raygun_shutdown_handler(e)
|
@@ -64,15 +70,13 @@ module Raygun
|
|
64
70
|
ActiveSupport::Notifications.unsubscribe(@sql_subscriber)
|
65
71
|
warn "[Raygun APM] notification hooks unsubscribed"
|
66
72
|
# Let the GC clean up the sink thread through the finalizer below
|
67
|
-
@tracer = nil
|
68
|
-
Thread.current.thread_variable_set(:_raygun_apm_tracer, nil)
|
73
|
+
@tracer = Raygun::Apm::Tracer.instance = nil
|
69
74
|
raise(exception) unless (Raygun::Apm::FatalError === exception)
|
70
75
|
end
|
71
76
|
|
72
77
|
def http_in_handler(args)
|
73
78
|
notification = ActiveSupport::Notifications::Event.new *args
|
74
79
|
if notification.payload[:exception]
|
75
|
-
warn "[Raygun APM] exception in HTTP IN event: #{notification.payload[:exception]}"
|
76
80
|
return
|
77
81
|
end
|
78
82
|
req = Rack::Request.new notification.payload[:headers].env
|
@@ -153,6 +157,10 @@ module Raygun
|
|
153
157
|
yield
|
154
158
|
end
|
155
159
|
|
160
|
+
def Ruby_APM_request_error
|
161
|
+
yield
|
162
|
+
end
|
163
|
+
|
156
164
|
def self.finalize(tracer)
|
157
165
|
proc {tracer.process_ended}
|
158
166
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raygun-apm-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raygun
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-03-
|
12
|
+
date: 2020-03-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: raygun-apm
|
@@ -76,6 +76,7 @@ extensions: []
|
|
76
76
|
extra_rdoc_files: []
|
77
77
|
files:
|
78
78
|
- ".gitignore"
|
79
|
+
- CHANGELOG.rdoc
|
79
80
|
- Gemfile
|
80
81
|
- Gemfile.lock
|
81
82
|
- README.rdoc
|
@@ -105,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
106
|
- !ruby/object:Gem::Version
|
106
107
|
version: '0'
|
107
108
|
requirements: []
|
108
|
-
rubygems_version: 3.
|
109
|
+
rubygems_version: 3.0.6
|
109
110
|
signing_key:
|
110
111
|
specification_version: 4
|
111
112
|
summary: Raygun application performance monitoring for Rails
|