raygun-apm-rails 1.1.4 → 1.1.5

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: 503c35a65596bf15fe6b21de389379d666ad61285f8d5a1b2e47bd040e79b565
4
- data.tar.gz: 7aed892aed451995f1665c32b5a6429fd16e44519eab3b4b0457e8ef4f748e5d
3
+ metadata.gz: 985a5c6277614425022e771885d60774cedc3adf7e6b984c72ab9492365ea98d
4
+ data.tar.gz: 69bd21d60eef2a3d224ee432b013c31e9907f008b80be5dd43256b0fbd135e47
5
5
  SHA512:
6
- metadata.gz: 23158e351ac2293d95887d083764b1b728885926dff2a4fadaff4a49ef63e57421cd820b6abfc4da107e53eb024cb46289f733bc43e34973c4889c917350e7d7
7
- data.tar.gz: 433f0aaef732aafa5cfce06b710b73ef629d7e0014193906fba5832fbd1d93eb32fa5903d598c4a20090207298c78a1e558e576eb829ab3ff47345b7a0fc7429
6
+ metadata.gz: 90ed4a1ed6485598e332867679ec9386e60b0b7b637faeb165a713cc49f54dbcbf77d8291b3eacb23c5b43fc49aaf44782e4ab3827da71c43ef0ee1c6ad70242
7
+ data.tar.gz: 6024ec51294d4bdf19d664d9e2583013211c8e91ca3908eb594b0301224869de517386a8e4e7666ab35bcf7af7f67ea472442ba6131d718d955d57a191ebbbdf
@@ -7,11 +7,13 @@ module Raygun
7
7
  @app = app
8
8
  @mutex = Mutex.new
9
9
  @tracer = nil
10
+ @http_in_subscriber = nil
11
+ @sql_subscriber = nil
10
12
  end
11
13
 
12
14
  def call(env)
13
- @status, @headers, @response = instrument(env)
14
- [@status, @headers, @response]
15
+ status, headers, response = instrument(env)
16
+ [status, headers, response]
15
17
  end
16
18
 
17
19
  private
@@ -27,7 +29,7 @@ module Raygun
27
29
  end
28
30
  if @tracer
29
31
  # For the exceptional HTTP IN handler
30
- @request_started = @tracer.now
32
+ Thread.current[:_raygun_request_started] = @tracer.now
31
33
  @tracer.start_trace
32
34
  end
33
35
  exception = nil
@@ -78,7 +80,9 @@ module Raygun
78
80
  warn "[Raygun APM] shutting down due to error - #{exception.message} #{exception.backtrace.join("\n")}",
79
81
  # Kill extended event subcriptions
80
82
  ActiveSupport::Notifications.unsubscribe(@http_in_subscriber)
83
+ @http_in_subscriber = nil
81
84
  ActiveSupport::Notifications.unsubscribe(@sql_subscriber)
85
+ @sql_subscriber = nil
82
86
  warn "[Raygun APM] notification hooks unsubscribed"
83
87
  @tracer.end_trace if @tracer
84
88
  # Let the GC clean up the sink thread through the finalizer below
@@ -130,7 +134,7 @@ module Raygun
130
134
  event[:url] = req.url
131
135
  event[:verb] = req.request_method
132
136
  event[:status] = 500
133
- event[:duration] = @tracer.now - @request_started
137
+ event[:duration] = @tracer.now - Thread.current[:_raygun_request_started]
134
138
  event[:timestamp] = @tracer.now
135
139
  event[:tid] = @tracer.get_thread_id(Thread.current)
136
140
  @tracer.emit(event)
@@ -140,7 +144,7 @@ module Raygun
140
144
  end
141
145
 
142
146
  def http_in_event
143
- @http_in_event ||= Raygun::Apm::Event::HttpIn.new
147
+ Thread.current[:_raygun_http_in_event] ||= Raygun::Apm::Event::HttpIn.new
144
148
  end
145
149
 
146
150
  def sql_handler(args)
@@ -180,7 +184,7 @@ module Raygun
180
184
  end
181
185
 
182
186
  def sql_event
183
- @sql_event ||= Raygun::Apm::Event::Sql.new
187
+ Thread.current[:_raygun_sql_event] ||= Raygun::Apm::Event::Sql.new
184
188
  end
185
189
 
186
190
  def Ruby_APM_profiler_trace
@@ -1,7 +1,7 @@
1
1
  module Raygun
2
2
  module Apm
3
3
  module Rails
4
- VERSION = "1.1.4"
4
+ VERSION = "1.1.5"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raygun-apm-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raygun Limited
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-13 00:00:00.000000000 Z
11
+ date: 2022-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: raygun-apm