sentry-rails 5.28.1 → 6.0.0
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/Gemfile +2 -14
- data/lib/sentry/rails/active_job.rb +7 -11
- data/lib/sentry/rails/configuration.rb +0 -1
- data/lib/sentry/rails/overrides/streaming_reporter.rb +0 -11
- data/lib/sentry/rails/railtie.rb +3 -8
- data/lib/sentry/rails/version.rb +1 -1
- data/sentry-rails.gemspec +3 -3
- metadata +11 -14
- data/lib/sentry/rails/breadcrumb/monotonic_active_support_logger.rb +0 -46
- data/lib/sentry/rails/instrument_payload_cleanup_helper.rb +0 -15
- data/lib/sentry/rails/tracing/action_controller_subscriber.rb +0 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f1d7d083cce7bf8f0e04a82c63fd1284f836e2ae3aa30a9237eba989e72ae93
|
4
|
+
data.tar.gz: 681cc6a28160e9f8138cdfc2a9c9c8ab81e2a90e43559306d30061e92fe63c91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db6546de2db3507a022eff373b10bed7380568fd40055c50b3e80cfe907ecc2479799e7fbfc5f598baa7ebbf92e410823fe71951cd8ae664c15714bb8e49c607
|
7
|
+
data.tar.gz: c71fe0109e60f59e36c91d0e3cbc95c8f34cb5b7b767261e68f40c04716b7d296939ad507ff7166bb618f63fac78b0865313ba2f6b685ba46b659c7175a38575
|
data/Gemfile
CHANGED
@@ -21,10 +21,8 @@ rails_version = ENV.fetch("RAILS_VERSION") do
|
|
21
21
|
"8.0"
|
22
22
|
elsif ruby_version >= Gem::Version.new("3.1")
|
23
23
|
"7.2"
|
24
|
-
|
24
|
+
else
|
25
25
|
"7.1"
|
26
|
-
elsif ruby_version >= Gem::Version.new("2.4")
|
27
|
-
"5.2"
|
28
26
|
end
|
29
27
|
end
|
30
28
|
|
@@ -42,11 +40,7 @@ elsif rails_version >= Gem::Version.new("7.1.0")
|
|
42
40
|
elsif rails_version >= Gem::Version.new("6.1.0")
|
43
41
|
gem "rspec-rails", "~> 4.0"
|
44
42
|
|
45
|
-
|
46
|
-
gem "sqlite3", "~> 1.7.3", platform: :ruby
|
47
|
-
else
|
48
|
-
gem "sqlite3", "~> 1.6.9", platform: :ruby
|
49
|
-
end
|
43
|
+
gem "sqlite3", "~> 1.7.3", platform: :ruby
|
50
44
|
else
|
51
45
|
gem "psych", "~> 3.0.0"
|
52
46
|
gem "rspec-rails", "~> 4.0"
|
@@ -58,12 +52,6 @@ else
|
|
58
52
|
end
|
59
53
|
end
|
60
54
|
|
61
|
-
if ruby_version < Gem::Version.new("2.5.0")
|
62
|
-
# https://github.com/flavorjones/loofah/pull/267
|
63
|
-
# loofah changed the required ruby version in a patch so we need to explicitly pin it
|
64
|
-
gem "loofah", "2.20.0"
|
65
|
-
end
|
66
|
-
|
67
55
|
gem "mini_magick"
|
68
56
|
|
69
57
|
gem "sprockets-rails"
|
@@ -32,17 +32,13 @@ module Sentry
|
|
32
32
|
Sentry.with_scope do |scope|
|
33
33
|
begin
|
34
34
|
scope.set_transaction_name(job.class.name, source: :task)
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
op: OP_NAME,
|
43
|
-
origin: SPAN_ORIGIN
|
44
|
-
)
|
45
|
-
end
|
35
|
+
|
36
|
+
transaction = Sentry.start_transaction(
|
37
|
+
name: scope.transaction_name,
|
38
|
+
source: scope.transaction_source,
|
39
|
+
op: OP_NAME,
|
40
|
+
origin: SPAN_ORIGIN
|
41
|
+
)
|
46
42
|
|
47
43
|
scope.set_span(transaction) if transaction
|
48
44
|
|
@@ -9,17 +9,6 @@ module Sentry
|
|
9
9
|
super
|
10
10
|
end
|
11
11
|
end
|
12
|
-
|
13
|
-
module OldStreamingReporter
|
14
|
-
def self.included(base)
|
15
|
-
base.send(:alias_method_chain, :log_error, :raven)
|
16
|
-
end
|
17
|
-
|
18
|
-
def log_error_with_raven(exception)
|
19
|
-
Sentry::Rails.capture_exception(exception)
|
20
|
-
log_error_without_raven(exception)
|
21
|
-
end
|
22
|
-
end
|
23
12
|
end
|
24
13
|
end
|
25
14
|
end
|
data/lib/sentry/rails/railtie.rb
CHANGED
@@ -101,17 +101,12 @@ module Sentry
|
|
101
101
|
end
|
102
102
|
|
103
103
|
def inject_breadcrumbs_logger
|
104
|
-
if Sentry.configuration.breadcrumbs_logger.include?(:active_support_logger)
|
104
|
+
if Sentry.configuration.breadcrumbs_logger.include?(:active_support_logger) ||
|
105
|
+
## legacy name redirected for backwards compat
|
106
|
+
Sentry.configuration.breadcrumbs_logger.include?(:monotonic_active_support_logger)
|
105
107
|
require "sentry/rails/breadcrumb/active_support_logger"
|
106
108
|
Sentry::Rails::Breadcrumb::ActiveSupportLogger.inject(Sentry.configuration.rails.active_support_logger_subscription_items)
|
107
109
|
end
|
108
|
-
|
109
|
-
if Sentry.configuration.breadcrumbs_logger.include?(:monotonic_active_support_logger)
|
110
|
-
return warn "Usage of `monotonic_active_support_logger` require a version of Rails >= 6.1, please upgrade your Rails version or use another logger" if ::Rails.version.to_f < 6.1
|
111
|
-
|
112
|
-
require "sentry/rails/breadcrumb/monotonic_active_support_logger"
|
113
|
-
Sentry::Rails::Breadcrumb::MonotonicActiveSupportLogger.inject
|
114
|
-
end
|
115
110
|
end
|
116
111
|
|
117
112
|
def setup_backtrace_cleanup_callback
|
data/lib/sentry/rails/version.rb
CHANGED
data/sentry-rails.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.license = 'MIT'
|
12
12
|
|
13
13
|
spec.platform = Gem::Platform::RUBY
|
14
|
-
spec.required_ruby_version = '>= 2.
|
14
|
+
spec.required_ruby_version = '>= 2.7'
|
15
15
|
spec.extra_rdoc_files = ["README.md", "LICENSE.txt"]
|
16
16
|
spec.files = `git ls-files | grep -Ev '^(spec|benchmarks|examples|\.rubocop\.yml)'`.split("\n")
|
17
17
|
|
@@ -30,6 +30,6 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
31
|
spec.require_paths = ["lib"]
|
32
32
|
|
33
|
-
spec.add_dependency "railties", ">= 5.0"
|
34
|
-
spec.add_dependency "sentry-ruby", "~>
|
33
|
+
spec.add_dependency "railties", ">= 5.2.0"
|
34
|
+
spec.add_dependency "sentry-ruby", "~> 6.0.0"
|
35
35
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
@@ -15,28 +15,28 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - ">="
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version:
|
18
|
+
version: 5.2.0
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - ">="
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version:
|
25
|
+
version: 5.2.0
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: sentry-ruby
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
30
30
|
- - "~>"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 6.0.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: 6.0.0
|
40
40
|
description: A gem that provides Rails integration for the Sentry error logger
|
41
41
|
email: accounts@sentry.io
|
42
42
|
executables: []
|
@@ -65,14 +65,12 @@ files:
|
|
65
65
|
- lib/sentry/rails/background_worker.rb
|
66
66
|
- lib/sentry/rails/backtrace_cleaner.rb
|
67
67
|
- lib/sentry/rails/breadcrumb/active_support_logger.rb
|
68
|
-
- lib/sentry/rails/breadcrumb/monotonic_active_support_logger.rb
|
69
68
|
- lib/sentry/rails/capture_exceptions.rb
|
70
69
|
- lib/sentry/rails/configuration.rb
|
71
70
|
- lib/sentry/rails/controller_methods.rb
|
72
71
|
- lib/sentry/rails/controller_transaction.rb
|
73
72
|
- lib/sentry/rails/engine.rb
|
74
73
|
- lib/sentry/rails/error_subscriber.rb
|
75
|
-
- lib/sentry/rails/instrument_payload_cleanup_helper.rb
|
76
74
|
- lib/sentry/rails/log_subscriber.rb
|
77
75
|
- lib/sentry/rails/log_subscribers/action_controller_subscriber.rb
|
78
76
|
- lib/sentry/rails/log_subscribers/action_mailer_subscriber.rb
|
@@ -85,22 +83,21 @@ files:
|
|
85
83
|
- lib/sentry/rails/structured_logging.rb
|
86
84
|
- lib/sentry/rails/tracing.rb
|
87
85
|
- lib/sentry/rails/tracing/abstract_subscriber.rb
|
88
|
-
- lib/sentry/rails/tracing/action_controller_subscriber.rb
|
89
86
|
- lib/sentry/rails/tracing/action_view_subscriber.rb
|
90
87
|
- lib/sentry/rails/tracing/active_record_subscriber.rb
|
91
88
|
- lib/sentry/rails/tracing/active_storage_subscriber.rb
|
92
89
|
- lib/sentry/rails/tracing/active_support_subscriber.rb
|
93
90
|
- lib/sentry/rails/version.rb
|
94
91
|
- sentry-rails.gemspec
|
95
|
-
homepage: https://github.com/getsentry/sentry-ruby/tree/
|
92
|
+
homepage: https://github.com/getsentry/sentry-ruby/tree/6.0.0/sentry-rails
|
96
93
|
licenses:
|
97
94
|
- MIT
|
98
95
|
metadata:
|
99
|
-
homepage_uri: https://github.com/getsentry/sentry-ruby/tree/
|
100
|
-
source_code_uri: https://github.com/getsentry/sentry-ruby/tree/
|
101
|
-
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/
|
96
|
+
homepage_uri: https://github.com/getsentry/sentry-ruby/tree/6.0.0/sentry-rails
|
97
|
+
source_code_uri: https://github.com/getsentry/sentry-ruby/tree/6.0.0/sentry-rails
|
98
|
+
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/6.0.0/CHANGELOG.md
|
102
99
|
bug_tracker_uri: https://github.com/getsentry/sentry-ruby/issues
|
103
|
-
documentation_uri: http://www.rubydoc.info/gems/sentry-rails/
|
100
|
+
documentation_uri: http://www.rubydoc.info/gems/sentry-rails/6.0.0
|
104
101
|
rdoc_options: []
|
105
102
|
require_paths:
|
106
103
|
- lib
|
@@ -108,7 +105,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
105
|
requirements:
|
109
106
|
- - ">="
|
110
107
|
- !ruby/object:Gem::Version
|
111
|
-
version: '2.
|
108
|
+
version: '2.7'
|
112
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
110
|
requirements:
|
114
111
|
- - ">="
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "sentry/rails/instrument_payload_cleanup_helper"
|
4
|
-
|
5
|
-
module Sentry
|
6
|
-
module Rails
|
7
|
-
module Breadcrumb
|
8
|
-
module MonotonicActiveSupportLogger
|
9
|
-
class << self
|
10
|
-
include InstrumentPayloadCleanupHelper
|
11
|
-
|
12
|
-
def add(name, started, _finished, _unique_id, data)
|
13
|
-
# skip Rails' internal events
|
14
|
-
return if name.start_with?("!")
|
15
|
-
|
16
|
-
if data.is_a?(Hash)
|
17
|
-
# we should only mutate the copy of the data
|
18
|
-
data = data.dup
|
19
|
-
cleanup_data(data)
|
20
|
-
end
|
21
|
-
|
22
|
-
crumb = Sentry::Breadcrumb.new(
|
23
|
-
data: data,
|
24
|
-
category: name,
|
25
|
-
timestamp: started.to_i
|
26
|
-
)
|
27
|
-
Sentry.add_breadcrumb(crumb)
|
28
|
-
end
|
29
|
-
|
30
|
-
def inject
|
31
|
-
@subscriber = ::ActiveSupport::Notifications.monotonic_subscribe(/.*/) do |name, started, finished, unique_id, data|
|
32
|
-
# we only record events that has a float as started timestamp
|
33
|
-
if started.is_a?(Float)
|
34
|
-
add(name, started, finished, unique_id, data)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def detach
|
40
|
-
::ActiveSupport::Notifications.unsubscribe(@subscriber)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Sentry
|
4
|
-
module Rails
|
5
|
-
module InstrumentPayloadCleanupHelper
|
6
|
-
IGNORED_DATA_TYPES = [:request, :response, :headers, :exception, :exception_object, Tracing::START_TIMESTAMP_NAME]
|
7
|
-
|
8
|
-
def cleanup_data(data)
|
9
|
-
IGNORED_DATA_TYPES.each do |key|
|
10
|
-
data.delete(key) if data.key?(key)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "sentry/rails/tracing/abstract_subscriber"
|
4
|
-
require "sentry/rails/instrument_payload_cleanup_helper"
|
5
|
-
|
6
|
-
module Sentry
|
7
|
-
module Rails
|
8
|
-
module Tracing
|
9
|
-
class ActionControllerSubscriber < AbstractSubscriber
|
10
|
-
extend InstrumentPayloadCleanupHelper
|
11
|
-
|
12
|
-
EVENT_NAMES = ["process_action.action_controller"].freeze
|
13
|
-
OP_NAME = "view.process_action.action_controller"
|
14
|
-
SPAN_ORIGIN = "auto.view.rails"
|
15
|
-
|
16
|
-
def self.subscribe!
|
17
|
-
Sentry.sdk_logger.warn <<~MSG
|
18
|
-
DEPRECATION WARNING: sentry-rails has changed its approach on controller span recording and #{self.name} is now depreacted.
|
19
|
-
Please stop using or referencing #{self.name} as it will be removed in the next major release.
|
20
|
-
MSG
|
21
|
-
|
22
|
-
subscribe_to_event(EVENT_NAMES) do |event_name, duration, payload|
|
23
|
-
controller = payload[:controller]
|
24
|
-
action = payload[:action]
|
25
|
-
|
26
|
-
record_on_current_span(
|
27
|
-
op: OP_NAME,
|
28
|
-
origin: SPAN_ORIGIN,
|
29
|
-
start_timestamp: payload[START_TIMESTAMP_NAME],
|
30
|
-
description: "#{controller}##{action}",
|
31
|
-
duration: duration
|
32
|
-
) do |span|
|
33
|
-
payload = payload.dup
|
34
|
-
cleanup_data(payload)
|
35
|
-
span.set_data(:payload, payload)
|
36
|
-
span.set_http_status(payload[:status])
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|