raygun-apm-rails 1.0.37 → 1.0.43

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e67b0bcb91d871a5391736b9ce6d957cf024b74b7e107aecdaef46656cc59a0
4
- data.tar.gz: 72777711d1ca49c42f1fbdb578f3ba0142fba0fc423df4e2b838de360e56e060
3
+ metadata.gz: 2dfaff24a1cfbf7086523b4160e290a73940a5bab447f4eef934135eb47bd0fa
4
+ data.tar.gz: 33324df0e40b95fbd2a9075f629ef8807574a39e9bd6142c04a10e488900803e
5
5
  SHA512:
6
- metadata.gz: 0a8d7b51f640b98c49a7158296c164de52c91902f55ef513ef28d7f591d37f41472cd99c2a4aebe7652f13707c5a2a313c6df686e70086ed8e841f1cb7e9d327
7
- data.tar.gz: 57f3f14013a6014dc86763cd75e8a74e6301d6cfe8bc9a3f9bd5603d511a68b6e79e420b739da68f9ec6e407f6f4a2c2c05e583320ed3ba61fa7a65eaf2b0967
6
+ metadata.gz: 702ed81b592564035bb2b6ca85fd972dc838070398f2e311c2f25f4f24129fc63c49150e44182b2343fd064945796e9119a2f1840031dd5edaa36c090f2e65ad
7
+ data.tar.gz: 0ce40e5fa2a9d91ca3a32fee680e1a16baed537ee3ee2a134a5ed0dd404aa5cf706cc71281b43d6f73fefe75c3b17a6f9615893054c43bbdcb4b9f7db5c854b8
@@ -4,6 +4,7 @@ module Raygun
4
4
  class Middleware
5
5
  def initialize(app)
6
6
  @app = app
7
+ @mutex = Mutex.new
7
8
  @tracer = nil
8
9
  end
9
10
 
@@ -15,9 +16,14 @@ module Raygun
15
16
  private
16
17
 
17
18
  def instrument(env)
18
- res = nil
19
- # Can be nil if we had a fatal error
20
- @tracer = Raygun::Apm::Tracer.instance || init_tracer
19
+ # Ignore asset requests
20
+ if env['REQUEST_PATH'].match(/^\/assets\//)
21
+ return @app.call(env)
22
+ end
23
+ @mutex.synchronize do
24
+ # Can be nil if we had a fatal error
25
+ @tracer = Raygun::Apm::Tracer.instance || init_tracer
26
+ end
21
27
  if @tracer
22
28
  # For the exceptional HTTP IN handler
23
29
  @request_started = @tracer.now
@@ -28,18 +34,9 @@ module Raygun
28
34
  Ruby_APM_profiler_trace do
29
35
  begin
30
36
  res = @app.call(env)
31
- if res && (status = res.first) >= 400 && status < 600
32
- message = Rack::Utils::HTTP_STATUS_CODES[status]
33
- begin
34
- raise "HTTP #{status} #{message}"
35
- rescue => e
36
- crash_report_exception(e)
37
- end
38
- exceptional_http_in_handler(env, status) if @tracer
39
- end
40
37
  rescue => e
41
38
  crash_report_exception(e)
42
- exceptional_http_in_handler(env, 500) if @tracer
39
+ exceptional_http_in_handler(env) if @tracer
43
40
  exception = e
44
41
  end
45
42
  end
@@ -82,6 +79,7 @@ module Raygun
82
79
  ActiveSupport::Notifications.unsubscribe(@http_in_subscriber)
83
80
  ActiveSupport::Notifications.unsubscribe(@sql_subscriber)
84
81
  warn "[Raygun APM] notification hooks unsubscribed"
82
+ @tracer.end_trace
85
83
  # Let the GC clean up the sink thread through the finalizer below
86
84
  @tracer = Raygun::Apm::Tracer.instance = nil
87
85
  raise(exception) unless (Raygun::Apm::FatalError === exception)
@@ -104,7 +102,7 @@ module Raygun
104
102
  event[:pid] = Process.pid
105
103
  event[:url] = url
106
104
  event[:verb] = verb
107
- event[:status] = notification.payload[:status]
105
+ event[:status] = notification.payload[:status] || notification.payload[:headers]["action_controller.instance"].status
108
106
  # XXX constant milliseconds to microseconds
109
107
  event[:duration] = notification.duration * 1000
110
108
  event[:timestamp] = @tracer.now
@@ -116,13 +114,13 @@ module Raygun
116
114
  end
117
115
 
118
116
  # For middleware chain halts that does not trigger 'process_action.action_controller'
119
- def exceptional_http_in_handler(env, status)
117
+ def exceptional_http_in_handler(env)
120
118
  req = Rack::Request.new env
121
119
  event = http_in_event
122
120
  event[:pid] = Process.pid
123
121
  event[:url] = req.url
124
122
  event[:verb] = req.request_method
125
- event[:status] = status
123
+ event[:status] = 500
126
124
  event[:duration] = @tracer.now - @request_started
127
125
  event[:timestamp] = @tracer.now
128
126
  event[:tid] = @tracer.get_thread_id(Thread.current)
@@ -1,7 +1,7 @@
1
1
  module Raygun
2
2
  module Apm
3
3
  module Rails
4
- VERSION = "1.0.37"
4
+ VERSION = "1.0.43"
5
5
  end
6
6
  end
7
7
  end
@@ -13,14 +13,12 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = "https://raygun.com/platform/apm"
14
14
  #spec.license = "MIT"
15
15
 
16
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
17
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
- end
16
+ spec.files = Dir['README.rdoc', 'raygun-apm-rails.gemspec', 'lib/**/*', 'bin/**/*']
19
17
  spec.bindir = "exe"
20
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
19
  spec.require_paths = ["lib"]
22
20
 
23
- spec.add_dependency "raygun-apm", "~> 1.0.44"
21
+ spec.add_dependency "raygun-apm", "~> 1.0.53"
24
22
  spec.add_development_dependency "bundler", "~> 2.1.4"
25
23
  spec.add_development_dependency "rake", "~> 10.0"
26
24
  spec.add_development_dependency "minitest", "~> 5.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raygun-apm-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.37
4
+ version: 1.0.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raygun
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-06-28 00:00:00.000000000 Z
12
+ date: 2020-10-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: raygun-apm
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 1.0.44
20
+ version: 1.0.53
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 1.0.44
27
+ version: 1.0.53
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -75,12 +75,7 @@ executables: []
75
75
  extensions: []
76
76
  extra_rdoc_files: []
77
77
  files:
78
- - ".gitignore"
79
- - CHANGELOG.rdoc
80
- - Gemfile
81
- - Gemfile.lock
82
78
  - README.rdoc
83
- - Rakefile
84
79
  - bin/console
85
80
  - bin/setup
86
81
  - lib/raygun/apm/rails.rb
@@ -106,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
101
  - !ruby/object:Gem::Version
107
102
  version: '0'
108
103
  requirements: []
109
- rubygems_version: 3.0.6
104
+ rubygems_version: 3.1.2
110
105
  signing_key:
111
106
  specification_version: 4
112
107
  summary: Raygun application performance monitoring for Rails
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
- *.gem
@@ -1,88 +0,0 @@
1
- = Changelog
2
-
3
- == 1.0.37 (June 28, 2020)
4
-
5
- * Oust Raygun::Apm::Rails::Middleware#Ruby_APM_request_error as the Agent now allows empty body requests for specific error conditions
6
-
7
- == 1.0.36 (June 27, 2020)
8
-
9
- * Some blacklist cleanups and ambiguity removal
10
-
11
- == 1.0.35 (June 27, 2020)
12
-
13
- * Whitelist key ActiveStorage APIs
14
-
15
- == 1.0.34 (June 17, 2020)
16
-
17
- * Align with rubyesque blacklist syntax support from profiler version 1.0.44
18
-
19
- == 1.0.33 (June 7, 2020)
20
-
21
- * Integrate exception correlation with rayrun4ruby
22
-
23
- == 1.0.32 (June 6, 2020)
24
-
25
- * Move raygun4ruby whitelisting and blacklisting out to profiler core
26
-
27
- == 1.0.31 (May 17, 2020)
28
-
29
- * Remove the Tracer#process_started callback (set on begin transaction command now)
30
-
31
- == 1.0.30 (May 15, 2020)
32
-
33
- * Introduce support for Redis as client adapter
34
-
35
- == 1.0.29 (May 3, 2020)
36
-
37
- * Blacklist a new set of methods injected at runtime by Rails which leads to messy traces
38
-
39
- == 1.0.28 (April 11, 2020)
40
-
41
- * Prefer local variables to Rack::Request methods for event value assignment (Rails 4)
42
-
43
- == 1.0.27 (April 11, 2020)
44
-
45
- * Restore Rails 4 support with caveat that HTTP IN paths are not fully qualified with protocol, host and port
46
-
47
- == 1.0.26 (April 11, 2020)
48
-
49
- * Remove Rails 4 support (no headers element in the notifications hash for HTTP in)
50
-
51
- == 1.0.25 (April 11, 2020)
52
-
53
- * Only ever attempt to emit extended events if a tracer instance is alive
54
-
55
- == 1.0.24 (April 1, 2020)
56
-
57
- * Blacklist Enumeration
58
- * Unsubscribe from previously registered AS::Notifications subscribers as child processes emit double HTTP IN and SQL events otherwise
59
-
60
- == 1.0.23 (March 25, 2020)
61
-
62
- * Do not cache PID on HTTP IN and SQL event initializers
63
-
64
- == 1.0.22 (March 24, 2020)
65
-
66
- * Fix local variable typo in the Rails middleware
67
- * Blacklist TZInfo
68
-
69
- == 1.0.21 (March 19, 2020)
70
-
71
- * Further improvements of emitting exceptions and other error status codes for apps with and without raygun4ruby installed
72
-
73
- == 1.0.20 (March 18, 2020)
74
-
75
- * Introduce support for detecting the presence of raygun4ruby and integrate better with the exception tracker
76
-
77
- == 1.0.19 (March 16, 2020)
78
-
79
- * Improve trace emission of unhandled exceptions in a request context
80
-
81
- == 1.0.18 (March 15, 2020)
82
-
83
- * Ensure a better experience with raygun4ruby with only Raygun::track_exception whitelisted
84
- * Remove the warning on a HTTP IN event with an exception payload - spams STDOUT and already confused some testers
85
- * Ensure errors raised during request exception always result in a fully wrapped trace with a 500 status
86
- * Wrap the exceptional HTTP IN error handler in a fake user code method too to get past the agent gate for that
87
- * Prefer the singleton interface on the Tracer
88
- * Blacklist HTTParty
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
@@ -1,24 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- raygun-apm-rails (1.0.37)
5
- raygun-apm (~> 1.0.44)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- minitest (5.13.0)
11
- rake (10.5.0)
12
- raygun-apm (1.0.46-x86-linux)
13
-
14
- PLATFORMS
15
- ruby
16
-
17
- DEPENDENCIES
18
- bundler (~> 2.1.4)
19
- minitest (~> 5.0)
20
- rake (~> 10.0)
21
- raygun-apm-rails!
22
-
23
- BUNDLED WITH
24
- 2.1.4
data/Rakefile DELETED
@@ -1,16 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
- require 'rdoc/task'
4
-
5
- RDoc::Task.new do |rdoc|
6
- rdoc.main = "README.rdoc"
7
- rdoc.rdoc_files.include("README.rdoc", "lib/raygun/apm/*.rb", "lib/raygun/apm/rails/*.rb")
8
- end
9
-
10
- Rake::TestTask.new(:test) do |t|
11
- t.libs << "test"
12
- t.libs << "lib"
13
- t.test_files = FileList["test/**/*_test.rb"]
14
- end
15
-
16
- task :default => :test