raygun-apm-rails 1.0.43 → 1.1.1

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: 2dfaff24a1cfbf7086523b4160e290a73940a5bab447f4eef934135eb47bd0fa
4
- data.tar.gz: 33324df0e40b95fbd2a9075f629ef8807574a39e9bd6142c04a10e488900803e
3
+ metadata.gz: 6fd600a0cf6ff91eb1811e1e5fc347abdc035f87bd7d56ca637dd26d5713382d
4
+ data.tar.gz: 72a599e8f61a4a44dea61f7184e2ccaad2c623367544052fc754592baa2d4218
5
5
  SHA512:
6
- metadata.gz: 702ed81b592564035bb2b6ca85fd972dc838070398f2e311c2f25f4f24129fc63c49150e44182b2343fd064945796e9119a2f1840031dd5edaa36c090f2e65ad
7
- data.tar.gz: 0ce40e5fa2a9d91ca3a32fee680e1a16baed537ee3ee2a134a5ed0dd404aa5cf706cc71281b43d6f73fefe75c3b17a6f9615893054c43bbdcb4b9f7db5c854b8
6
+ metadata.gz: beac4f57fedaa8760d871a589a3e4105a99327cf138c9a5c13047525b58cb7bebfc66cf9c07fa65d36e9c26aabe54f87cc8ece6fa6ea1d9b5816122ca48913fa
7
+ data.tar.gz: 164a0948df7229af3a2555608328174affac04eca80336e528bfaf5dc102fcc9917023501bf1987bc82c294ed60e0b980cbc093644c8d9de857569fb1bc82a0a
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.
@@ -2,6 +2,7 @@ module Raygun
2
2
  module Apm
3
3
  module Rails
4
4
  class Middleware
5
+ POSTGRESQLSTRING = "postgresql"
5
6
  def initialize(app)
6
7
  @app = app
7
8
  @mutex = Mutex.new
@@ -17,7 +18,7 @@ module Raygun
17
18
 
18
19
  def instrument(env)
19
20
  # Ignore asset requests
20
- if env['REQUEST_PATH'].match(/^\/assets\//)
21
+ if (env['REQUEST_PATH'] || env['REQUEST_URI']).match(/^\/assets\//)
21
22
  return @app.call(env)
22
23
  end
23
24
  @mutex.synchronize do
@@ -35,15 +36,15 @@ module Raygun
35
36
  begin
36
37
  res = @app.call(env)
37
38
  rescue => e
38
- crash_report_exception(e)
39
+ crash_report_exception(e, env)
39
40
  exceptional_http_in_handler(env) if @tracer
40
41
  exception = e
41
42
  end
42
43
  end
43
44
  # Can be nil if we had a fatal error
44
45
  if @tracer
45
- @tracer.end_trace
46
46
  @tracer.diagnostics if ENV['PROTON_DIAGNOSTICS']
47
+ @tracer.end_trace
47
48
  end
48
49
  raise exception if exception
49
50
  res
@@ -147,7 +148,7 @@ module Raygun
147
148
 
148
149
  # XXX this is hacky
149
150
  if config = connection.instance_variable_get('@config')
150
- event[:provider] = config[:adapter]
151
+ event[:provider] = get_sql_provider_name(config)
151
152
  event[:host] = config[:host]
152
153
  event[:database] = config[:database]
153
154
  end
@@ -162,6 +163,14 @@ module Raygun
162
163
  raygun_shutdown_handler(e)
163
164
  end
164
165
 
166
+ #This function adjusts the provider name for PostgreSQL to Postgres because all other Raygun profilers use Postgres and this will keep the UI consistent across supported languages
167
+ def get_sql_provider_name(config)
168
+ if config[:adapter] == POSTGRESQLSTRING
169
+ return "postgres"
170
+ end
171
+ config[:adapter]
172
+ end
173
+
165
174
  def sql_event
166
175
  @sql_event ||= Raygun::Apm::Event::Sql.new
167
176
  end
@@ -174,9 +183,10 @@ module Raygun
174
183
  yield
175
184
  end
176
185
 
177
- def crash_report_exception(exception)
186
+ def crash_report_exception(exception, env = {})
178
187
  if Raygun::Apm::Rails.raygun4ruby?
179
- Raygun.track_exception(exception, correlation_id: exception.instance_variable_get(:@__raygun_correlation_id))
188
+ env.merge!(correlation_id: exception.instance_variable_get(:@__raygun_correlation_id))
189
+ Raygun.track_exception(exception, env)
180
190
  end
181
191
  end
182
192
 
@@ -1,7 +1,7 @@
1
1
  module Raygun
2
2
  module Apm
3
3
  module Rails
4
- VERSION = "1.0.43"
4
+ VERSION = "1.1.1"
5
5
  end
6
6
  end
7
7
  end
@@ -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", "Erkki Eilonen"]
10
- spec.email = ["support@raygun.com", "info@bearmetal.eu"]
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
- #spec.license = "MIT"
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", "~> 1.0.53"
21
+ spec.add_dependency "raygun-apm"
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.0.43
4
+ version: 1.1.1
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: 2020-10-11 00:00:00.000000000 Z
11
+ date: 2021-05-23 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: 1.0.53
19
+ version: '0'
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: 1.0.53
26
+ version: '0'
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: []