raygun-apm-rails 0.1.17 → 1.0.3

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: 05c94e26072a3cc6fa28f93a282ff4959ee65af938385bfc9e92ff9b9579b272
4
- data.tar.gz: e443936f063325a320242f10b8c586b8149c7f5d7db8f36ccba1f800ff5eaed7
3
+ metadata.gz: eea6a446a20e4aa80579fdb5e67c73bc98bc54c7660263b22d68f2446b1d89ed
4
+ data.tar.gz: 7b39d07857691aa62c77c3f039c81870d2fe804b0a0bdcdf9c383b88c4c98078
5
5
  SHA512:
6
- metadata.gz: 6137d60a60f974f4722b274db2c14ff6455927563f870daf9586b998ab12d97f75436bf13d3ff105e2e2a14835bfb0f652825124b3b42e9ef280786b127f3bdc
7
- data.tar.gz: 332eb53c2cc736afde6b0b66cb1edfa775679574538c662b8911186f3b5cdbdc5654a2cf49699263864be443f2c1ec61821234b95941748a82b676f11bb71989
6
+ metadata.gz: 4d2579171bed2d5f63ec45db6ae1e3a8ac178eba56b918c8a1bb57acd6f34834d913e01bec1a3fe1219309cd1ea09ba2460755617bce76f15d5438dc4112dd66
7
+ data.tar.gz: 74313954758d795a519132b86b664a08bdefc2a33c111fd00aa6412739ba9aded7dacc64e58df560cf6675309ab144019ef5dc85c794c25b458e68d1820230ff
@@ -67,7 +67,7 @@ instrument HTTP request / response workloads.
67
67
  The following extended events are captured:
68
68
 
69
69
  * HTTP inbound - the request URI, HTTP verb and other details of the current request
70
+ * HTTP outbound - the URI, HTTP verb and time taken (typically external APIs)
70
71
  * Database queries - SQL statement, provider, database etc.
71
72
 
72
- {Contact us}[https://raygun.com/about/contact] to support other workloads such as
73
- specific background processing frameworks.
73
+ {Contact us}[https://raygun.com/about/contact] to support other specific web frameworks.
@@ -57,6 +57,7 @@ module Raygun
57
57
  Puma
58
58
  PG
59
59
  EnabledModule
60
+ ConnectionPool
60
61
  +Raygun::Apm::Rails::Middleware::start_of_trace
61
62
  }
62
63
  end
@@ -41,20 +41,21 @@ module Raygun
41
41
  raygun_shutdown_handler(e)
42
42
  end
43
43
 
44
- def start_of_trace
45
- yield
46
- end
47
-
48
44
  def raygun_shutdown_handler(exception)
49
- warn "Raygun APM shutting down due to error - %s", e.message
45
+ warn "[Raygun APM] shutting down due to error - #{exception.message}",
50
46
  # Kill extended event subcriptions
51
47
  ActiveSupport::Notifications.unsubscribe(@http_in_subscriber)
52
48
  ActiveSupport::Notifications.unsubscribe(@sql_subscriber)
49
+ warn "[Raygun APM] notification hooks unsubscribed"
53
50
  # Shutdown the tracepoint if enabled to reduce any overhead and stall emission
54
- @tracer.tracepoint.stop if @tracer.tracepoint.enabled?
51
+ if @tracer.tracepoint.enabled?
52
+ @tracer.tracepoint.stop
53
+ warn "[Raygun APM] tracepoint stopped"
54
+ end
55
55
  # Let the GC clean up the sink thread through the finalizer below
56
56
  @tracer = nil
57
57
  Thread.current.thread_variable_set(:_raygun_apm_tracer, nil)
58
+ unless (Raygun::Apm::FatalError === exception) raise(exception)
58
59
  end
59
60
 
60
61
  def http_in_handler(args)
@@ -70,11 +71,12 @@ module Raygun
70
71
  event[:status] = notification.payload[:status]
71
72
  # XXX constant milliseconds to microseconds
72
73
  event[:duration] = notification.duration * 1000
73
- event[:timestamp] = notification.time.to_f * 1000000
74
+ event[:timestamp] = @tracer.now
74
75
  event[:tid] = @tracer.get_thread_id(Thread.current)
75
76
  @tracer.emit(event)
76
77
  rescue => e
77
78
  warn "[Raygun APM] error reporting HTTP IN event"
79
+ raygun_shutdown_handler(e)
78
80
  end
79
81
 
80
82
  def http_in_event
@@ -109,6 +111,7 @@ module Raygun
109
111
  @tracer.emit(event)
110
112
  rescue => e
111
113
  warn "[Raygun APM] error reporting SQL event"
114
+ raygun_shutdown_handler(e)
112
115
  end
113
116
 
114
117
  def sql_event
@@ -119,6 +122,10 @@ module Raygun
119
122
  end
120
123
  end
121
124
 
125
+ def start_of_trace
126
+ yield
127
+ end
128
+
122
129
  def self.finalize(tracer)
123
130
  proc {tracer.process_ended}
124
131
  end
@@ -2,7 +2,7 @@ module Raygun
2
2
  module Apm
3
3
  module Rails
4
4
  class Railtie < ::Rails::Railtie
5
- initializer "raygun.apm" do |app|
5
+ initializer "raygun.apm.rails" do |app|
6
6
  require "raygun/apm"
7
7
  require "raygun/apm/rails/middleware"
8
8
  Raygun::Apm::Blacklist.extend_with Raygun::Apm::Rails::BLACKLIST
@@ -1,7 +1,7 @@
1
1
  module Raygun
2
2
  module Apm
3
3
  module Rails
4
- VERSION = "0.1.17"
4
+ VERSION = "1.0.3"
5
5
  end
6
6
  end
7
7
  end
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ["lib"]
25
25
 
26
- spec.add_dependency "raygun-apm", "~> 0.0.10"
26
+ spec.add_dependency "raygun-apm", "~> 1.0.0"
27
27
  spec.add_development_dependency "bundler", "~> 1.17"
28
28
  spec.add_development_dependency "rake", "~> 10.0"
29
29
  spec.add_development_dependency "minitest", "~> 5.0"
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.17
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erkki Eilonen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-12 00:00:00.000000000 Z
11
+ date: 2020-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: raygun-apm
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.10
19
+ version: 1.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.10
26
+ version: 1.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubygems_version: 3.0.6
106
+ rubygems_version: 3.0.3
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Raygun application performance monitoring for Rails