raygun-apm-rails 1.1.0 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/lib/raygun/apm/rails/middleware.rb +11 -3
- data/lib/raygun/apm/rails/railtie.rb +0 -3
- data/lib/raygun/apm/rails/version.rb +1 -1
- data/raygun-apm-rails.gemspec +5 -5
- metadata +11 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 503c35a65596bf15fe6b21de389379d666ad61285f8d5a1b2e47bd040e79b565
|
4
|
+
data.tar.gz: 7aed892aed451995f1665c32b5a6429fd16e44519eab3b4b0457e8ef4f748e5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23158e351ac2293d95887d083764b1b728885926dff2a4fadaff4a49ef63e57421cd820b6abfc4da107e53eb024cb46289f733bc43e34973c4889c917350e7d7
|
7
|
+
data.tar.gz: 433f0aaef732aafa5cfce06b710b73ef629d7e0014193906fba5832fbd1d93eb32fa5903d598c4a20090207298c78a1e558e576eb829ab3ff47345b7a0fc7429
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2021 Raygun Limited
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -54,7 +54,7 @@ module Raygun
|
|
54
54
|
|
55
55
|
def init_tracer
|
56
56
|
tracer = Raygun::Apm::Tracer.new
|
57
|
-
tracer.
|
57
|
+
tracer.enable_sink!
|
58
58
|
ObjectSpace.define_finalizer(self, self.class.finalize(tracer))
|
59
59
|
|
60
60
|
ActiveSupport::Notifications.unsubscribe(@http_in_subscriber) if @http_in_subscriber
|
@@ -80,9 +80,10 @@ module Raygun
|
|
80
80
|
ActiveSupport::Notifications.unsubscribe(@http_in_subscriber)
|
81
81
|
ActiveSupport::Notifications.unsubscribe(@sql_subscriber)
|
82
82
|
warn "[Raygun APM] notification hooks unsubscribed"
|
83
|
-
@tracer.end_trace
|
83
|
+
@tracer.end_trace if @tracer
|
84
84
|
# Let the GC clean up the sink thread through the finalizer below
|
85
85
|
@tracer = Raygun::Apm::Tracer.instance = nil
|
86
|
+
crash_report_exception(exception)
|
86
87
|
raise(exception) unless (Raygun::Apm::FatalError === exception)
|
87
88
|
end
|
88
89
|
|
@@ -103,7 +104,7 @@ module Raygun
|
|
103
104
|
event[:pid] = Process.pid
|
104
105
|
event[:url] = url
|
105
106
|
event[:verb] = verb
|
106
|
-
event[:status] = notification
|
107
|
+
event[:status] = http_in_status(notification)
|
107
108
|
# XXX constant milliseconds to microseconds
|
108
109
|
event[:duration] = notification.duration * 1000
|
109
110
|
event[:timestamp] = @tracer.now
|
@@ -114,6 +115,13 @@ module Raygun
|
|
114
115
|
raygun_shutdown_handler(e)
|
115
116
|
end
|
116
117
|
|
118
|
+
def http_in_status(notification)
|
119
|
+
notification.payload[:status] || notification.payload[:headers]["action_controller.instance"].status
|
120
|
+
rescue
|
121
|
+
warn "[Raygun APM] error inferring HTTP status, fallback to 200"
|
122
|
+
200
|
123
|
+
end
|
124
|
+
|
117
125
|
# For middleware chain halts that does not trigger 'process_action.action_controller'
|
118
126
|
def exceptional_http_in_handler(env)
|
119
127
|
req = Rack::Request.new env
|
@@ -11,9 +11,6 @@ module Raygun
|
|
11
11
|
app.middleware.delete Raygun::Middleware::RackExceptionInterceptor
|
12
12
|
end
|
13
13
|
app.middleware.use Raygun::Apm::Rails::Middleware
|
14
|
-
# Explictly enable instrumenting HTTP until a good control API is figured out
|
15
|
-
require "raygun/apm/hooks/net_http"
|
16
|
-
require "raygun/apm/hooks/redis" if defined?(Redis::Client)
|
17
14
|
end
|
18
15
|
end
|
19
16
|
end
|
data/raygun-apm-rails.gemspec
CHANGED
@@ -6,19 +6,19 @@ require "raygun/apm/rails/version"
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "raygun-apm-rails"
|
8
8
|
spec.version = Raygun::Apm::Rails::VERSION
|
9
|
-
spec.authors = ["Raygun
|
10
|
-
spec.email = ["
|
9
|
+
spec.authors = ["Raygun Limited"]
|
10
|
+
spec.email = ["ruby-apm@raygun.io", "support@raygun.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{Raygun application performance monitoring for Rails}
|
13
13
|
spec.homepage = "https://raygun.com/platform/apm"
|
14
|
-
|
14
|
+
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.files = Dir['README.rdoc', 'raygun-apm-rails.gemspec', 'lib/**/*', 'bin/**/*']
|
16
|
+
spec.files = Dir['README.rdoc', 'LICENSE', 'raygun-apm-rails.gemspec', 'lib/**/*', 'bin/**/*']
|
17
17
|
spec.bindir = "exe"
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "raygun-apm"
|
21
|
+
spec.add_dependency "raygun-apm", "~> 1.1.11"
|
22
22
|
spec.add_development_dependency "bundler", "~> 2.1.4"
|
23
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
24
|
spec.add_development_dependency "minitest", "~> 5.0"
|
metadata
CHANGED
@@ -1,30 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raygun-apm-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Raygun
|
8
|
-
- Erkki Eilonen
|
7
|
+
- Raygun Limited
|
9
8
|
autorequire:
|
10
9
|
bindir: exe
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2022-02-13 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: raygun-apm
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
16
|
requirements:
|
18
|
-
- - "
|
17
|
+
- - "~>"
|
19
18
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
19
|
+
version: 1.1.11
|
21
20
|
type: :runtime
|
22
21
|
prerelease: false
|
23
22
|
version_requirements: !ruby/object:Gem::Requirement
|
24
23
|
requirements:
|
25
|
-
- - "
|
24
|
+
- - "~>"
|
26
25
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
26
|
+
version: 1.1.11
|
28
27
|
- !ruby/object:Gem::Dependency
|
29
28
|
name: bundler
|
30
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,12 +68,13 @@ dependencies:
|
|
69
68
|
version: '5.0'
|
70
69
|
description:
|
71
70
|
email:
|
71
|
+
- ruby-apm@raygun.io
|
72
72
|
- support@raygun.com
|
73
|
-
- info@bearmetal.eu
|
74
73
|
executables: []
|
75
74
|
extensions: []
|
76
75
|
extra_rdoc_files: []
|
77
76
|
files:
|
77
|
+
- LICENSE
|
78
78
|
- README.rdoc
|
79
79
|
- bin/console
|
80
80
|
- bin/setup
|
@@ -84,7 +84,8 @@ files:
|
|
84
84
|
- lib/raygun/apm/rails/version.rb
|
85
85
|
- raygun-apm-rails.gemspec
|
86
86
|
homepage: https://raygun.com/platform/apm
|
87
|
-
licenses:
|
87
|
+
licenses:
|
88
|
+
- MIT
|
88
89
|
metadata: {}
|
89
90
|
post_install_message:
|
90
91
|
rdoc_options: []
|