raygun-apm-rails 1.0.20 → 1.0.25

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 274ea9a538eec6a7f3b33798485bb8a34e125d6b7656f6da6190b137d2a50667
4
- data.tar.gz: e3083172f595177fbcca74e9206bb241c17f703e532ffb7c16d18322b75218a8
3
+ metadata.gz: e1ed60ffbe45aae39cb1950c0c264018437c3c144ec7bbe178a5c172c062b72d
4
+ data.tar.gz: 01f3aec28f93c40c6339187270b4bf2ca0fddbcd64a6dab67bd6af2040c20e4e
5
5
  SHA512:
6
- metadata.gz: 7ab24ef63ac928dc823e96181a1b1f5be51839f4b13646b07571686680eea2482dbedd0134e4959bcd4233d07ca8e6f80883308ba67922e11a2e77f3a9a9c9b5
7
- data.tar.gz: '0988caffa77325919b9fb2d3d31bbc90229ecf424bc52686980f3c5a6953d9e67f54407f02550acc8073e118296512a372ffb476e032bdc471cd02b0b3d17322'
6
+ metadata.gz: 2eb362b074e81d3c2f9c149c040f6c328f6c1adbe567382edddf2f683517fc01e4d56f43540603683af2d5092f62749076985dac92f33f0c5cc6b71b3e16afd6
7
+ data.tar.gz: 2c3887fcfdf1b57008bca5a4f7ff9e9f41e8c0ec787895fea293fae073b9f044180438a0f3b20819c037ae0c453135e76ba2c8f97ba1f50c5f92d91c2c52bf96
@@ -1,5 +1,27 @@
1
1
  = Changelog
2
2
 
3
+ == 1.0.25 (April 11, 2020)
4
+
5
+ * Only ever attempt to emit extended events if a tracer instance is alive
6
+
7
+ == 1.0.24 (April 1, 2020)
8
+
9
+ * Blacklist Enumeration
10
+ * Unsubscribe from previously registered AS::Notifications subscribers as child processes emit double HTTP IN and SQL events otherwise
11
+
12
+ == 1.0.23 (March 25, 2020)
13
+
14
+ * Do not cache PID on HTTP IN and SQL event initializers
15
+
16
+ == 1.0.22 (March 24, 2020)
17
+
18
+ * Fix local variable typo in the Rails middleware
19
+ * Blacklist TZInfo
20
+
21
+ == 1.0.21 (March 19, 2020)
22
+
23
+ * Further improvements of emitting exceptions and other error status codes for apps with and without raygun4ruby installed
24
+
3
25
  == 1.0.20 (March 18, 2020)
4
26
 
5
27
  * Introduce support for detecting the presence of raygun4ruby and integrate better with the exception tracker
@@ -1,24 +1,24 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- raygun-apm-rails (0.1.0)
5
- raygun-apm (~> 0.0.8)
4
+ raygun-apm-rails (1.0.24)
5
+ raygun-apm (~> 1.0.15)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  minitest (5.13.0)
11
11
  rake (10.5.0)
12
- raygun-apm (0.0.8-x86-linux)
12
+ raygun-apm (1.0.23-universal-darwin)
13
13
 
14
14
  PLATFORMS
15
15
  ruby
16
16
 
17
17
  DEPENDENCIES
18
- bundler (~> 1.17)
18
+ bundler (~> 2.1.4)
19
19
  minitest (~> 5.0)
20
20
  rake (~> 10.0)
21
21
  raygun-apm-rails!
22
22
 
23
23
  BUNDLED WITH
24
- 1.17.3
24
+ 2.1.4
@@ -68,6 +68,15 @@ module Raygun
68
68
  Loofah
69
69
  WebConsole
70
70
  HTTParty
71
+ TZInfo
72
+ Devise
73
+ Marginalia
74
+ FastGettext
75
+ Lograge
76
+ Warden
77
+ Grape
78
+ Mustermann
79
+ Enumeration
71
80
  Raygun::Breadcrumbs
72
81
  Raygun::Configuration
73
82
  Raygun::config
@@ -17,7 +17,7 @@ module Raygun
17
17
  def instrument(env)
18
18
  res = nil
19
19
  # Can be nil if we had a fatal error
20
- @tracer ||= Raygun::Apm::Tracer.instance || 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
@@ -28,17 +28,26 @@ module Raygun
28
28
  Ruby_APM_profiler_trace do
29
29
  begin
30
30
  res = @app.call(env)
31
+ if res && (status = res.first) >= 400 && status < 600
32
+ Ruby_APM_request_error do
33
+ message = Rack::Utils::HTTP_STATUS_CODES[status]
34
+ begin
35
+ raise "HTTP #{status} #{message}"
36
+ rescue => e
37
+ Raygun.track_exception(e, env) if Raygun::Apm::Rails.raygun4ruby?
38
+ end
39
+ exceptional_http_in_handler(env, status) if @tracer
40
+ end
41
+ end
31
42
  rescue => e
32
43
  Ruby_APM_request_error do
44
+ raise e rescue nil
33
45
  Raygun.track_exception(e, env) if Raygun::Apm::Rails.raygun4ruby?
34
- exceptional_http_in_handler(env, 500)
46
+ exceptional_http_in_handler(env, 500) if @tracer
35
47
  end
36
- exection = e
48
+ exception = e
37
49
  end
38
50
  end
39
- if res && (status = res.first) >= 400 && status < 600
40
- Ruby_APM_request_error { exceptional_http_in_handler(env, status) }
41
- end
42
51
  # Can be nil if we had a fatal error
43
52
  @tracer.end_trace if @tracer
44
53
  raise exception if exception
@@ -53,12 +62,14 @@ module Raygun
53
62
  tracer.process_started
54
63
  ObjectSpace.define_finalizer(self, self.class.finalize(tracer))
55
64
 
65
+ ActiveSupport::Notifications.unsubscribe(@http_in_subscriber) if @http_in_subscriber
56
66
  @http_in_subscriber = ActiveSupport::Notifications.subscribe('process_action.action_controller') do |*args|
57
- http_in_handler(args)
67
+ http_in_handler(args) if @tracer
58
68
  end
59
69
 
70
+ ActiveSupport::Notifications.unsubscribe(@sql_subscriber) if @sql_subscriber
60
71
  @sql_subscriber = ActiveSupport::Notifications.subscribe('sql.active_record') do |*args|
61
- sql_handler(args)
72
+ sql_handler(args) if @tracer
62
73
  end
63
74
 
64
75
  GC.stress = true if ENV['RAYGUN_STRESS_GC']
@@ -86,6 +97,7 @@ module Raygun
86
97
  end
87
98
  req = Rack::Request.new notification.payload[:headers].env
88
99
  event = http_in_event
100
+ event[:pid] = Process.pid
89
101
  event[:url] = req.url
90
102
  event[:verb] = req.request_method
91
103
  event[:status] = notification.payload[:status]
@@ -103,6 +115,7 @@ module Raygun
103
115
  def exceptional_http_in_handler(env, status)
104
116
  req = Rack::Request.new env
105
117
  event = http_in_event
118
+ event[:pid] = Process.pid
106
119
  event[:url] = req.url
107
120
  event[:verb] = req.request_method
108
121
  event[:status] = status
@@ -116,11 +129,7 @@ module Raygun
116
129
  end
117
130
 
118
131
  def http_in_event
119
- @http_in_event ||= begin
120
- event = Raygun::Apm::Event::HttpIn.new
121
- event[:pid] = Process.pid
122
- event
123
- end
132
+ @http_in_event ||= Raygun::Apm::Event::HttpIn.new
124
133
  end
125
134
 
126
135
  def sql_handler(args)
@@ -131,6 +140,7 @@ module Raygun
131
140
  ObjectSpace._id2ref(notification.payload[:connection_id])
132
141
  end
133
142
  event = sql_event
143
+ event[:pid] = Process.pid
134
144
  event[:query] = notification.payload[:sql]
135
145
 
136
146
  # XXX this is hacky
@@ -151,11 +161,7 @@ module Raygun
151
161
  end
152
162
 
153
163
  def sql_event
154
- @sql_event ||= begin
155
- event = Raygun::Apm::Event::Sql.new
156
- event[:pid] = Process.pid
157
- event
158
- end
164
+ @sql_event ||= Raygun::Apm::Event::Sql.new
159
165
  end
160
166
 
161
167
  def Ruby_APM_profiler_trace
@@ -1,7 +1,7 @@
1
1
  module Raygun
2
2
  module Apm
3
3
  module Rails
4
- VERSION = "1.0.20"
4
+ VERSION = "1.0.25"
5
5
  end
6
6
  end
7
7
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ["lib"]
22
22
 
23
23
  spec.add_dependency "raygun-apm", "~> 1.0.15"
24
- spec.add_development_dependency "bundler", "~> 1.17"
24
+ spec.add_development_dependency "bundler", "~> 2.1.4"
25
25
  spec.add_development_dependency "rake", "~> 10.0"
26
26
  spec.add_development_dependency "minitest", "~> 5.0"
27
27
  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.20
4
+ version: 1.0.25
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-18 00:00:00.000000000 Z
12
+ date: 2020-04-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: raygun-apm
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '1.17'
34
+ version: 2.1.4
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '1.17'
41
+ version: 2.1.4
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement