raygun-apm-rails 0.1.1 → 0.1.6

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: 5f1cfc377ee4a15c8160f23bac1bdff917d2e6b685fa865cce7450d2cdb99966
4
- data.tar.gz: 90f0af8896b520cc25d5fe0edc2e5561c1add0cc4dfbd8809a843557caae985b
3
+ metadata.gz: 5bded6633ee12299036cbbc4335ab2d2332375299aa2746c507801791cc0b886
4
+ data.tar.gz: 5e4e99d585dfe5e1b970c4857088ad2fec161f7935677e9b3545b947b7164ee6
5
5
  SHA512:
6
- metadata.gz: a1976c28914986dceffd77e17b15b5fbcecab3d81e4c2f90b12c334ecf115ce270b72c831f6243026ec7bec133b4c97fd116e9c18cb6eeb252959b9a91d2befc
7
- data.tar.gz: b69a00664ffd1d149fc228e136cddc06f5f9bfe4f8c4e9171896c4a5b5595bc21c68c8c448cea233907d9887bf60e822da27755090fdbd9801086bbf7f003b8c
6
+ metadata.gz: 18a5b450114214cfb18be5de0091e5cf93ef8c59e0f5d37103d3e641b650e6855fac6c59668170b0b6b3888aa6d51d4f5c466912e050331c0f10f7ef7c1c2610
7
+ data.tar.gz: 2439fa20850563b3be76f8ffab6c362250d452388cd309c8f5d6a0cd62261a56c9620a022a60bda54db405be97a5e41af6e8f2153206b2982d22a6ec068c23a4
@@ -56,8 +56,16 @@ module Raygun
56
56
  Mysql2
57
57
  Erubi
58
58
  ApplicationController
59
+ RequestStore
60
+ WEBrick
61
+ Puma
62
+ PG
63
+ EnabledModule
59
64
  }
60
65
 
66
+ BOUNDARY = %w{
67
+ +RequestStore::Middleware::call
68
+ }
61
69
  end
62
70
  end
63
71
  end
@@ -34,7 +34,7 @@ module Raygun
34
34
  # Can be nil if we had a fatal error
35
35
  @tracer.end_trace if @tracer
36
36
  res
37
- rescue Raygun::APM::FatalError => e
37
+ rescue Raygun::Apm::FatalError => e
38
38
  raygun_shutdown_handler(e)
39
39
  end
40
40
 
@@ -52,22 +52,22 @@ module Raygun
52
52
  def http_in_handler(args)
53
53
  notification = ActiveSupport::Notifications::Event.new *args
54
54
  if notification.payload[:exception]
55
- # XXX notify?
55
+ warn "[Raygun APM] exception in HTTP IN event: #{notification.payload[:exception]}"
56
56
  return
57
57
  end
58
58
  req = Rack::Request.new notification.payload[:headers].env
59
- event = Raygun::Apm::Event::HttpIn.new
60
- event[:url] = req.url
61
- event[:verb] = req.request_method
62
- event[:status] = notification.payload[:status]
59
+ @http_in_event ||= Raygun::Apm::Event::HttpIn.new
60
+ @http_in_event[:url] = req.url
61
+ @http_in_event[:verb] = req.request_method
62
+ @http_in_event[:status] = notification.payload[:status]
63
63
  # XXX constant milliseconds to microseconds
64
- event[:duration] = notification.duration * 1000
65
- event[:timestamp] = Time.now.to_f*1000000
66
- event[:pid] = Process.pid
67
- event[:tid] = @tracer.get_thread_id(Thread.current)
68
- @tracer.emit(event)
64
+ @http_in_event[:duration] = notification.duration * 1000
65
+ @http_in_event[:timestamp] = notification.time.to_f * 1000000
66
+ @http_in_event[:pid] = Process.pid
67
+ @http_in_event[:tid] = @tracer.get_thread_id(Thread.current)
68
+ @tracer.emit(@http_in_event)
69
69
  rescue => e
70
- # XXX report
70
+ warn "[Raygun APM] error reporting HTTP IN event"
71
71
  end
72
72
 
73
73
  def sql_handler(args)
@@ -77,24 +77,24 @@ module Raygun
77
77
  else
78
78
  ObjectSpace._id2ref(notification.payload[:connection_id])
79
79
  end
80
- event = Raygun::Apm::Event::Sql.new
81
- event[:query] = notification.payload[:sql]
80
+ @sql_event ||= Raygun::Apm::Event::Sql.new
81
+ @sql_event[:query] = notification.payload[:sql]
82
82
 
83
83
  # XXX this is hacky
84
84
  if config = connection.instance_variable_get('@config')
85
- event[:provider] = config[:adapter]
86
- event[:host] = config[:host]
87
- event[:database] = config[:database]
85
+ @sql_event[:provider] = config[:adapter]
86
+ @sql_event[:host] = config[:host]
87
+ @sql_event[:database] = config[:database]
88
88
  end
89
89
 
90
90
  # XXX constant milliseconds to microseconds
91
- event[:duration] = notification.duration * 1000
92
- event[:timestamp] = Time.now.to_f*1000000
93
- event[:pid] = Process.pid
94
- event[:tid] = @tracer.get_thread_id(Thread.current)
95
- @tracer.emit(event)
91
+ @sql_event[:duration] = notification.duration * 1000
92
+ @sql_event[:timestamp] = notification.time.to_f * 1000000
93
+ @sql_event[:pid] = Process.pid
94
+ @sql_event[:tid] = @tracer.get_thread_id(Thread.current)
95
+ @tracer.emit(@sql_event)
96
96
  rescue => e
97
- # XXX report
97
+ warn "[Raygun APM] error reporting SQL event"
98
98
  end
99
99
 
100
100
  def self.finalize(tracer)
@@ -6,7 +6,8 @@ module Raygun
6
6
  require "raygun/apm"
7
7
  require "raygun/apm/rails/middleware"
8
8
  Raygun::Apm::Blacklist.extend_with Raygun::Apm::Rails::BLACKLIST
9
- app.middleware.use Raygun::Apm::Rails::Middleware
9
+ Raygun::Apm::Blacklist.extend_with Raygun::Apm::Rails::BOUNDARY
10
+ app.middleware.insert_before Rack::Sendfile, Raygun::Apm::Rails::Middleware
10
11
  end
11
12
  end
12
13
  end
@@ -1,7 +1,7 @@
1
1
  module Raygun
2
2
  module Apm
3
3
  module Rails
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.6"
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: 0.1.1
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erkki Eilonen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-19 00:00:00.000000000 Z
11
+ date: 2019-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: raygun-apm
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  requirements: []
107
- rubygems_version: 3.0.6
107
+ rubygems_version: 3.0.3
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Raygun application performance monitoring for Rails