raygun-apm-rails 0.1.16 → 1.0.2
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/README.rdoc +2 -2
- data/lib/raygun/apm/rails.rb +2 -0
- data/lib/raygun/apm/rails/middleware.rb +15 -5
- data/lib/raygun/apm/rails/railtie.rb +1 -1
- data/lib/raygun/apm/rails/version.rb +1 -1
- data/raygun-apm-rails.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 972f897c0a6e69018d07c34bfab44aa517ab7900a3bd0aa41ab21c0831c397d8
|
4
|
+
data.tar.gz: 51ea730f564db85a57486d2f608fe605f032114282c939b87fb0402dd46b6bb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 043f0b6968c4452220d3c6d7447c7ae642cfc4d9c6ebd410da0e80a435332bb3d688008b202380b614e61dd15ab80741338cf9ed7c1d1ee16380b714cf43d7a8
|
7
|
+
data.tar.gz: '08f907fbd3d88ee5f731537f80acbd4f4aaef4de60225534deb0bfb1d961671f0889ec7da22d47e056ce63eb027cbf02ece44a9e97865c6938282e5edb31fd21'
|
data/README.rdoc
CHANGED
@@ -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
|
73
|
-
specific background processing frameworks.
|
73
|
+
{Contact us}[https://raygun.com/about/contact] to support other specific web frameworks.
|
data/lib/raygun/apm/rails.rb
CHANGED
@@ -33,21 +33,25 @@ module Raygun
|
|
33
33
|
Thread.current.thread_variable_set(:_raygun_apm_tracer, @tracer)
|
34
34
|
@tracer.start_trace
|
35
35
|
end
|
36
|
-
res = @app.call(env)
|
36
|
+
res = start_of_trace{ @app.call(env) }
|
37
37
|
# Can be nil if we had a fatal error
|
38
38
|
@tracer.end_trace if @tracer
|
39
39
|
res
|
40
40
|
rescue Raygun::Apm::FatalError => e
|
41
41
|
raygun_shutdown_handler(e)
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
def raygun_shutdown_handler(exception)
|
45
|
-
warn "Raygun APM shutting down due to error -
|
45
|
+
warn "[Raygun APM] shutting down due to error - #{exception.message}",
|
46
46
|
# Kill extended event subcriptions
|
47
47
|
ActiveSupport::Notifications.unsubscribe(@http_in_subscriber)
|
48
48
|
ActiveSupport::Notifications.unsubscribe(@sql_subscriber)
|
49
|
+
warn "[Raygun APM] notification hooks unsubscribed"
|
49
50
|
# Shutdown the tracepoint if enabled to reduce any overhead and stall emission
|
50
|
-
|
51
|
+
if @tracer.tracepoint.enabled?
|
52
|
+
@tracer.tracepoint.stop
|
53
|
+
warn "[Raygun APM] tracepoint stopped"
|
54
|
+
end
|
51
55
|
# Let the GC clean up the sink thread through the finalizer below
|
52
56
|
@tracer = nil
|
53
57
|
Thread.current.thread_variable_set(:_raygun_apm_tracer, nil)
|
@@ -66,11 +70,12 @@ module Raygun
|
|
66
70
|
event[:status] = notification.payload[:status]
|
67
71
|
# XXX constant milliseconds to microseconds
|
68
72
|
event[:duration] = notification.duration * 1000
|
69
|
-
event[:timestamp] =
|
73
|
+
event[:timestamp] = @tracer.now
|
70
74
|
event[:tid] = @tracer.get_thread_id(Thread.current)
|
71
75
|
@tracer.emit(event)
|
72
76
|
rescue => e
|
73
77
|
warn "[Raygun APM] error reporting HTTP IN event"
|
78
|
+
raygun_shutdown_handler(e)
|
74
79
|
end
|
75
80
|
|
76
81
|
def http_in_event
|
@@ -105,6 +110,7 @@ module Raygun
|
|
105
110
|
@tracer.emit(event)
|
106
111
|
rescue => e
|
107
112
|
warn "[Raygun APM] error reporting SQL event"
|
113
|
+
raygun_shutdown_handler(e)
|
108
114
|
end
|
109
115
|
|
110
116
|
def sql_event
|
@@ -115,6 +121,10 @@ module Raygun
|
|
115
121
|
end
|
116
122
|
end
|
117
123
|
|
124
|
+
def start_of_trace
|
125
|
+
yield
|
126
|
+
end
|
127
|
+
|
118
128
|
def self.finalize(tracer)
|
119
129
|
proc {tracer.process_ended}
|
120
130
|
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
|
data/raygun-apm-rails.gemspec
CHANGED
@@ -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
|
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.
|
4
|
+
version: 1.0.2
|
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-
|
11
|
+
date: 2020-02-17 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
|
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
|
26
|
+
version: 1.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|