sentry-rails 4.3.0 → 4.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/Gemfile +3 -1
- data/app/jobs/sentry/send_event_job.rb +5 -0
- data/lib/sentry/rails.rb +1 -1
- data/lib/sentry/rails/background_worker.rb +0 -2
- data/lib/sentry/rails/configuration.rb +11 -0
- data/lib/sentry/rails/railtie.rb +16 -13
- data/lib/sentry/rails/version.rb +1 -1
- data/sentry-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: 48f0349352e2f19b3be18c7ea0e5b7a600ad72d01ed1d2ce4052e55b7df471c3
|
4
|
+
data.tar.gz: 7f2c6d5f3e2f2ec40cd797e81856951beced5fde6897cc993dfa8c2046ba7800
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0eef4c4a1a50168a669fdf786f78842ca45c6c0d04e1ec1b9f783ad86f0a70bf94a40b6207ab8334a6cfaec953bdbdbe7dc8f04c3301dbf62a02656ebb0e24b8
|
7
|
+
data.tar.gz: c5d28ee621ed6ad90a520a6e5c8fce8047a38907a493c706c5bb9f77304884b70e0564ddc90689214a0e919e6a8f6ea5d3ecbfea44de3c32bf934a74dd9459ec
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,29 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 4.3.4
|
4
|
+
|
5
|
+
- Don't assign Rails.logger if it's not present [#1387](https://github.com/getsentry/sentry-ruby/pull/1387)
|
6
|
+
- Fixes [#1386](https://github.com/getsentry/sentry-ruby/issues/1386)
|
7
|
+
|
8
|
+
## 4.3.3
|
9
|
+
|
10
|
+
- Correctly set the SDK's logger in sentry-rails [#1363](https://github.com/getsentry/sentry-ruby/pull/1363)
|
11
|
+
- Fixes [#1361](https://github.com/getsentry/sentry-ruby/issues/1361)
|
12
|
+
|
13
|
+
## 4.3.3-beta.0
|
14
|
+
|
15
|
+
- Minimize sentry-rails' dependency requirement [#1352](https://github.com/getsentry/sentry-ruby/pull/1352)
|
16
|
+
|
17
|
+
## 4.3.2
|
18
|
+
|
19
|
+
- Avoid recording SendEventJob's transaction [#1351](https://github.com/getsentry/sentry-ruby/pull/1351)
|
20
|
+
- Fixes [#1348](https://github.com/getsentry/sentry-ruby/issues/1348)
|
21
|
+
|
22
|
+
## 4.3.1
|
23
|
+
|
24
|
+
- Only apply background worker patch if ActiveRecord is loaded [#1350](https://github.com/getsentry/sentry-ruby/pull/1350)
|
25
|
+
- Fixes [#1342](https://github.com/getsentry/sentry-ruby/issues/1342) and [#1346](https://github.com/getsentry/sentry-ruby/issues/1346)
|
26
|
+
|
3
27
|
## 4.3.0
|
4
28
|
|
5
29
|
### Features
|
data/Gemfile
CHANGED
@@ -17,11 +17,13 @@ end
|
|
17
17
|
|
18
18
|
gem "rails", "~> #{rails_version}"
|
19
19
|
gem "sprockets-rails"
|
20
|
+
|
21
|
+
gem "rspec", "~> 3.0"
|
22
|
+
gem "rspec-retry"
|
20
23
|
gem "rspec-rails", "~> 4.0"
|
21
24
|
gem "codecov", "0.2.12"
|
22
25
|
|
23
26
|
gem "rake", "~> 12.0"
|
24
|
-
gem "rspec", "~> 3.0"
|
25
27
|
|
26
28
|
# TODO: Remove this if https://github.com/jruby/jruby/issues/6547 is addressed
|
27
29
|
gem "i18n", "<= 1.8.7"
|
@@ -22,6 +22,11 @@ if defined?(ActiveJob)
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def perform(event, hint = {})
|
25
|
+
# users don't need the tracing result of this job
|
26
|
+
if transaction = Sentry.get_current_scope.span
|
27
|
+
transaction.instance_variable_set(:@sampled, false)
|
28
|
+
end
|
29
|
+
|
25
30
|
Sentry.send_event(event, hint)
|
26
31
|
end
|
27
32
|
end
|
data/lib/sentry/rails.rb
CHANGED
@@ -5,6 +5,17 @@ module Sentry
|
|
5
5
|
add_post_initialization_callback do
|
6
6
|
@rails = Sentry::Rails::Configuration.new
|
7
7
|
@excluded_exceptions = @excluded_exceptions.concat(Sentry::Rails::IGNORE_DEFAULT)
|
8
|
+
|
9
|
+
if ::Rails.logger
|
10
|
+
@logger = ::Rails.logger
|
11
|
+
else
|
12
|
+
@logger.warn(Sentry::LOGGER_PROGNAME) do
|
13
|
+
<<~MSG
|
14
|
+
sentry-rails can't detect Rails.logger. it may be caused by misplacement of the SDK initialization code
|
15
|
+
please make sure you place the Sentry.init block under the `config/initializers` folder, e.g. `config/initializers/sentry.rb`
|
16
|
+
MSG
|
17
|
+
end
|
18
|
+
end
|
8
19
|
end
|
9
20
|
end
|
10
21
|
|
data/lib/sentry/rails/railtie.rb
CHANGED
@@ -1,11 +1,6 @@
|
|
1
|
-
require "rails"
|
2
1
|
require "sentry/rails/capture_exceptions"
|
3
2
|
require "sentry/rails/rescued_exception_interceptor"
|
4
3
|
require "sentry/rails/backtrace_cleaner"
|
5
|
-
require "sentry/rails/controller_methods"
|
6
|
-
require "sentry/rails/controller_transaction"
|
7
|
-
require "sentry/rails/overrides/streaming_reporter"
|
8
|
-
require "sentry/rails/overrides/file_handler"
|
9
4
|
|
10
5
|
module Sentry
|
11
6
|
class Railtie < ::Rails::Railtie
|
@@ -21,12 +16,12 @@ module Sentry
|
|
21
16
|
next unless Sentry.initialized?
|
22
17
|
|
23
18
|
configure_project_root
|
24
|
-
configure_sentry_logger
|
25
19
|
configure_trusted_proxies
|
26
|
-
extend_controller_methods
|
20
|
+
extend_controller_methods if defined?(ActionController)
|
27
21
|
extend_active_job if defined?(ActiveJob)
|
28
|
-
|
29
|
-
|
22
|
+
patch_background_worker if defined?(ActiveRecord)
|
23
|
+
override_streaming_reporter if defined?(ActionView)
|
24
|
+
override_file_handler if defined?(ActionDispatch) && app.config.public_file_server.enabled
|
30
25
|
setup_backtrace_cleanup_callback
|
31
26
|
inject_breadcrumbs_logger
|
32
27
|
activate_tracing
|
@@ -36,10 +31,6 @@ module Sentry
|
|
36
31
|
Sentry.configuration.project_root = ::Rails.root.to_s
|
37
32
|
end
|
38
33
|
|
39
|
-
def configure_sentry_logger
|
40
|
-
Sentry.configuration.logger = ::Rails.logger
|
41
|
-
end
|
42
|
-
|
43
34
|
def configure_trusted_proxies
|
44
35
|
Sentry.configuration.trusted_proxies += Array(::Rails.application.config.action_dispatch.trusted_proxies)
|
45
36
|
end
|
@@ -50,6 +41,10 @@ module Sentry
|
|
50
41
|
end
|
51
42
|
|
52
43
|
def extend_controller_methods
|
44
|
+
require "sentry/rails/controller_methods"
|
45
|
+
require "sentry/rails/controller_transaction"
|
46
|
+
require "sentry/rails/overrides/streaming_reporter"
|
47
|
+
|
53
48
|
ActiveSupport.on_load :action_controller do
|
54
49
|
include Sentry::Rails::ControllerMethods
|
55
50
|
include Sentry::Rails::ControllerTransaction
|
@@ -57,6 +52,10 @@ module Sentry
|
|
57
52
|
end
|
58
53
|
end
|
59
54
|
|
55
|
+
def patch_background_worker
|
56
|
+
require "sentry/rails/background_worker"
|
57
|
+
end
|
58
|
+
|
60
59
|
def inject_breadcrumbs_logger
|
61
60
|
if Sentry.configuration.breadcrumbs_logger.include?(:active_support_logger)
|
62
61
|
require 'sentry/rails/breadcrumb/active_support_logger'
|
@@ -73,12 +72,16 @@ module Sentry
|
|
73
72
|
end
|
74
73
|
|
75
74
|
def override_streaming_reporter
|
75
|
+
require "sentry/rails/overrides/streaming_reporter"
|
76
|
+
|
76
77
|
ActiveSupport.on_load :action_view do
|
77
78
|
ActionView::StreamingTemplateRenderer::Body.send(:prepend, Sentry::Rails::Overrides::StreamingReporter)
|
78
79
|
end
|
79
80
|
end
|
80
81
|
|
81
82
|
def override_file_handler
|
83
|
+
require "sentry/rails/overrides/file_handler"
|
84
|
+
|
82
85
|
ActiveSupport.on_load :action_controller do
|
83
86
|
ActionDispatch::FileHandler.send(:prepend, Sentry::Rails::Overrides::FileHandler)
|
84
87
|
end
|
data/lib/sentry/rails/version.rb
CHANGED
data/sentry-rails.gemspec
CHANGED
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
|
-
spec.add_dependency "
|
25
|
+
spec.add_dependency "railties", ">= 5.0"
|
26
26
|
spec.add_dependency "sentry-ruby-core", "~> 4.3.0"
|
27
27
|
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.3.
|
4
|
+
version: 4.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: railties
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -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.3
|
106
|
+
rubygems_version: 3.0.3.1
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: A gem that provides Rails integration for the Sentry error logger
|