sentry-rails 4.1.4 → 4.2.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 +4 -4
- data/CHANGELOG.md +66 -1
- data/Gemfile +10 -1
- data/Makefile +3 -0
- data/app/jobs/sentry/send_event_job.rb +30 -0
- data/lib/sentry/rails.rb +1 -0
- data/lib/sentry/rails/active_job.rb +25 -23
- data/lib/sentry/rails/breadcrumb/active_support_logger.rb +13 -3
- data/lib/sentry/rails/capture_exceptions.rb +21 -0
- data/lib/sentry/rails/configuration.rb +8 -2
- data/lib/sentry/rails/engine.rb +5 -0
- data/lib/sentry/rails/overrides/file_handler.rb +16 -0
- data/lib/sentry/rails/railtie.rb +21 -3
- data/lib/sentry/rails/rescued_exception_interceptor.rb +11 -0
- data/lib/sentry/rails/tracing/abstract_subscriber.rb +3 -3
- data/lib/sentry/rails/tracing/action_view_subscriber.rb +3 -11
- data/lib/sentry/rails/version.rb +1 -1
- data/sentry-rails.gemspec +2 -2
- metadata +10 -7
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab83fdc945ddfb3c5dbd4a38c34c8748acfc9745f5f9bbf39e47c188778760b6
|
4
|
+
data.tar.gz: 05ac3bde183e9615d292c2c978224b06567347c4b461cd8281d4f308d2b61bdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28819d457892ae94280d5f6f5ec44e23eeec4d52f338b68ccc31ccd5f090b63a560eb9b72b626c1bb011288e9beb0e3762eb14229a6b689d8f957aaf7a0ea867
|
7
|
+
data.tar.gz: 2e095079c8ea3e1f8ad552bbe0c94a0a93a87c199832cb19de2beaa242cacea95383bca18529316133949f4ba807fe0b1898783a36db26aacca74eac8c0fcf79
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,71 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 4.2.1
|
4
|
+
|
5
|
+
- Add additional checks to SendEventJob's definition [#1275](https://github.com/getsentry/sentry-ruby/pull/1275)
|
6
|
+
- Fixes [#1270](https://github.com/getsentry/sentry-ruby/issues/1270)
|
7
|
+
- Fixes [#1277](https://github.com/getsentry/sentry-ruby/issues/1277)
|
8
|
+
|
9
|
+
## 4.2.0
|
10
|
+
|
11
|
+
### Features
|
12
|
+
|
13
|
+
- Make sentry-rails a Rails engine and provide default job class for async [#1181](https://github.com/getsentry/sentry-ruby/pull/1181)
|
14
|
+
|
15
|
+
`sentry-rails` now provides a default ActiveJob class for sending events asynchronously. You can use it directly without define your own one:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
config.async = lambda { |event, hint| Sentry::SendEventJob.perform_later(event, hint) }
|
19
|
+
```
|
20
|
+
|
21
|
+
- Add configuration option for trusted proxies [#1126](https://github.com/getsentry/sentry-ruby/pull/1126)
|
22
|
+
|
23
|
+
`sentry-rails` now injects `Rails.application.config.action_dispatch.trusted_proxies` into `Sentry.configuration.trusted_proxies` automatically.
|
24
|
+
|
25
|
+
- Allow users to configure ActiveJob adapters to ignore [#1256](https://github.com/getsentry/sentry-ruby/pull/1256)
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
# sentry-rails will skip active_job reporting for jobs that use ActiveJob::QueueAdapters::SidekiqAdapter
|
29
|
+
# you should use this option when:
|
30
|
+
# - you don't want to see events from a certain adapter
|
31
|
+
# - you already have a better reporting setup for the adapter (like having `sentry-sidekiq` installed)
|
32
|
+
config.rails.skippable_job_adapters = ["ActiveJob::QueueAdapters::SidekiqAdapter"]
|
33
|
+
```
|
34
|
+
|
35
|
+
- Tag `job_id` and `provider_job_id` on ActiveJob events [#1259](https://github.com/getsentry/sentry-ruby/pull/1259)
|
36
|
+
|
37
|
+
<img width="1330" alt="example of tagged event" src="https://user-images.githubusercontent.com/5079556/106389781-3a03f100-6420-11eb-810c-a99869eb26dd.png">
|
38
|
+
|
39
|
+
- Use another method for post initialization callback [#1261](https://github.com/getsentry/sentry-ruby/pull/1261)
|
40
|
+
|
41
|
+
### Bug Fixes
|
42
|
+
|
43
|
+
- Inspect exception cause by default & don't exclude ActiveJob::DeserializationError [#1180](https://github.com/getsentry/sentry-ruby/pull/1180)
|
44
|
+
- Fixes [#1071](https://github.com/getsentry/sentry-ruby/issues/1071)
|
45
|
+
|
46
|
+
## 4.1.7
|
47
|
+
|
48
|
+
- Use env to carry original transaction name [#1255](https://github.com/getsentry/sentry-ruby/pull/1255)
|
49
|
+
- Fix duration of tracing event in Rails 5 [#1254](https://github.com/getsentry/sentry-ruby/pull/1254) (by @abcang)
|
50
|
+
- Filter out static file transaction [#1247](https://github.com/getsentry/sentry-ruby/pull/1247)
|
51
|
+
|
52
|
+
## 4.1.6
|
53
|
+
|
54
|
+
- Prevent exceptions app from overriding event's transaction name [#1230](https://github.com/getsentry/sentry-ruby/pull/1230)
|
55
|
+
- Fix project root detection [#1242](https://github.com/getsentry/sentry-ruby/pull/1242)
|
56
|
+
- Use sentry-ruby-core as the main SDK dependency [#1244](https://github.com/getsentry/sentry-ruby/pull/1244)
|
57
|
+
|
58
|
+
## 4.1.5
|
59
|
+
|
60
|
+
- Add `ActionDispatch::Http::MimeNegotiation::InvalidType` to the list of default ignored Rails exceptions [#1215](https://github.com/getsentry/sentry-ruby/pull/1215) (by @agrobbin)
|
61
|
+
- Continue ActiveJob execution if Sentry is not initialized [#1217](https://github.com/getsentry/sentry-ruby/pull/1217)
|
62
|
+
- Fixes [#1211](https://github.com/getsentry/sentry-ruby/issues/1211) and [#1216](https://github.com/getsentry/sentry-ruby/issues/1216)
|
63
|
+
- Only extend ActiveJob when it's defined [#1218](https://github.com/getsentry/sentry-ruby/pull/1218)
|
64
|
+
- Fixes [#1210](https://github.com/getsentry/sentry-ruby/issues/1210)
|
65
|
+
- Filter out redundant event/payload from breadcrumbs logger [#1222](https://github.com/getsentry/sentry-ruby/pull/1222)
|
66
|
+
- Copy request env before Rails' ShowExceptions middleware [#1223](https://github.com/getsentry/sentry-ruby/pull/1223)
|
67
|
+
- Don't subscribe render_partial and render_collection events [#1224](https://github.com/getsentry/sentry-ruby/pull/1224)
|
68
|
+
|
3
69
|
## 4.1.4
|
4
70
|
|
5
71
|
- Don't include headers & request info in tracing span or breadcrumb [#1199](https://github.com/getsentry/sentry-ruby/pull/1199)
|
@@ -52,4 +118,3 @@ Release test
|
|
52
118
|
## 0.1.0
|
53
119
|
|
54
120
|
First version
|
55
|
-
|
data/Gemfile
CHANGED
@@ -8,15 +8,24 @@ rails_version = "6.1.0" if rails_version.nil?
|
|
8
8
|
|
9
9
|
gem 'activerecord-jdbcmysql-adapter', platform: :jruby
|
10
10
|
gem "jdbc-sqlite3", platform: :jruby
|
11
|
-
|
11
|
+
|
12
|
+
if rails_version.to_f < 6
|
13
|
+
gem "sqlite3", "~> 1.3.0", platform: :ruby
|
14
|
+
else
|
15
|
+
gem "sqlite3", platform: :ruby
|
16
|
+
end
|
12
17
|
|
13
18
|
gem "rails", "~> #{rails_version}"
|
19
|
+
gem "sprockets-rails"
|
14
20
|
gem "rspec-rails", "~> 4.0"
|
15
21
|
gem "codecov", "0.2.12"
|
16
22
|
|
17
23
|
gem "rake", "~> 12.0"
|
18
24
|
gem "rspec", "~> 3.0"
|
19
25
|
|
26
|
+
# TODO: Remove this if https://github.com/jruby/jruby/issues/6547 is addressed
|
27
|
+
gem "i18n", "<= 1.8.7"
|
28
|
+
|
20
29
|
gem "sidekiq"
|
21
30
|
|
22
31
|
gem "sentry-ruby", path: "../sentry-ruby"
|
data/Makefile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
return unless defined?(ActiveJob)
|
2
|
+
|
3
|
+
module Sentry
|
4
|
+
parent_job =
|
5
|
+
if defined?(::ApplicationJob) && ::ApplicationJob.ancestors.include?(::ActiveJob::Base)
|
6
|
+
::ApplicationJob
|
7
|
+
else
|
8
|
+
::ActiveJob::Base
|
9
|
+
end
|
10
|
+
|
11
|
+
class SendEventJob < parent_job
|
12
|
+
# the event argument is usually large and creates noise
|
13
|
+
self.log_arguments = false if respond_to?(:log_arguments=)
|
14
|
+
|
15
|
+
# this will prevent infinite loop when there's an issue deserializing SentryJob
|
16
|
+
if respond_to?(:discard_on)
|
17
|
+
discard_on ActiveJob::DeserializationError
|
18
|
+
else
|
19
|
+
# mimic what discard_on does for Rails 5.0
|
20
|
+
rescue_from ActiveJob::DeserializationError do
|
21
|
+
logger.error "Discarded #{self.class} due to a #{exception}. The original exception was #{error.cause.inspect}."
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def perform(event, hint = {})
|
26
|
+
Sentry.send_event(event, hint)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
data/lib/sentry/rails.rb
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
module Sentry
|
2
2
|
module Rails
|
3
3
|
module ActiveJobExtensions
|
4
|
-
ALREADY_SUPPORTED_SENTRY_ADAPTERS = %w(
|
5
|
-
ActiveJob::QueueAdapters::SidekiqAdapter
|
6
|
-
).freeze
|
7
|
-
|
8
4
|
def self.included(base)
|
9
5
|
base.class_eval do
|
10
6
|
around_perform do |job, block|
|
11
|
-
if
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
if Sentry.initialized?
|
8
|
+
if already_supported_by_specific_integration?(job)
|
9
|
+
block.call
|
10
|
+
else
|
11
|
+
Sentry.with_scope do
|
12
|
+
capture_and_reraise_with_sentry(job, block)
|
13
|
+
end
|
16
14
|
end
|
15
|
+
else
|
16
|
+
block.call
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -25,28 +25,30 @@ module Sentry
|
|
25
25
|
rescue_handler_result = rescue_with_handler(e)
|
26
26
|
return rescue_handler_result if rescue_handler_result
|
27
27
|
|
28
|
-
Sentry::Rails.capture_exception(
|
28
|
+
Sentry::Rails.capture_exception(
|
29
|
+
e,
|
30
|
+
extra: sentry_context(job),
|
31
|
+
tags: {
|
32
|
+
job_id: job.job_id,
|
33
|
+
provider_job_id: job.provider_job_id
|
34
|
+
}
|
35
|
+
)
|
29
36
|
raise e
|
30
37
|
end
|
31
38
|
|
32
39
|
def already_supported_by_specific_integration?(job)
|
33
|
-
|
40
|
+
Sentry.configuration.rails.skippable_job_adapters.include?(job.class.queue_adapter.class.to_s)
|
34
41
|
end
|
35
42
|
|
36
43
|
def sentry_context(job)
|
37
|
-
|
38
|
-
:
|
39
|
-
:
|
40
|
-
:
|
41
|
-
:
|
42
|
-
:
|
44
|
+
{
|
45
|
+
active_job: job.class.name,
|
46
|
+
arguments: job.arguments,
|
47
|
+
scheduled_at: job.scheduled_at,
|
48
|
+
job_id: job.job_id,
|
49
|
+
provider_job_id: job.provider_job_id,
|
50
|
+
locale: job.locale
|
43
51
|
}
|
44
|
-
# Add provider_job_id details if Rails 5
|
45
|
-
if job.respond_to?(:provider_job_id)
|
46
|
-
ctx[:provider_job_id] = job.provider_job_id
|
47
|
-
end
|
48
|
-
|
49
|
-
ctx
|
50
52
|
end
|
51
53
|
end
|
52
54
|
end
|
@@ -3,12 +3,16 @@ module Sentry
|
|
3
3
|
module Breadcrumb
|
4
4
|
module ActiveSupportLogger
|
5
5
|
class << self
|
6
|
+
IGNORED_DATA_TYPES = [:request, :headers, :exception, :exception_object]
|
7
|
+
|
6
8
|
def add(name, started, _finished, _unique_id, data)
|
7
|
-
|
9
|
+
# skip Rails' internal events
|
10
|
+
return if name.start_with?("!")
|
11
|
+
|
12
|
+
if data.is_a?(Hash)
|
8
13
|
# we should only mutate the copy of the data
|
9
14
|
data = data.dup
|
10
|
-
data
|
11
|
-
data.delete(:headers)
|
15
|
+
cleanup_data(data)
|
12
16
|
end
|
13
17
|
|
14
18
|
crumb = Sentry::Breadcrumb.new(
|
@@ -19,6 +23,12 @@ module Sentry
|
|
19
23
|
Sentry.add_breadcrumb(crumb)
|
20
24
|
end
|
21
25
|
|
26
|
+
def cleanup_data(data)
|
27
|
+
IGNORED_DATA_TYPES.each do |key|
|
28
|
+
data.delete(key) if data.key?(key)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
22
32
|
def inject
|
23
33
|
@subscriber = ::ActiveSupport::Notifications.subscribe(/.*/) do |name, started, finished, unique_id, data|
|
24
34
|
# we only record events that has a started timestamp
|
@@ -1,6 +1,14 @@
|
|
1
1
|
module Sentry
|
2
2
|
module Rails
|
3
3
|
class CaptureExceptions < Sentry::Rack::CaptureExceptions
|
4
|
+
def initialize(app)
|
5
|
+
super
|
6
|
+
|
7
|
+
if defined?(::Sprockets::Rails)
|
8
|
+
@assets_regex = %r(\A/{0,2}#{::Rails.application.config.assets.prefix})
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
4
12
|
private
|
5
13
|
|
6
14
|
def collect_exception(env)
|
@@ -12,8 +20,21 @@ module Sentry
|
|
12
20
|
end
|
13
21
|
|
14
22
|
def capture_exception(exception)
|
23
|
+
current_scope = Sentry.get_current_scope
|
24
|
+
|
25
|
+
if original_transaction = current_scope.rack_env["sentry.original_transaction"]
|
26
|
+
current_scope.set_transaction_name(original_transaction)
|
27
|
+
end
|
28
|
+
|
15
29
|
Sentry::Rails.capture_exception(exception)
|
16
30
|
end
|
31
|
+
|
32
|
+
def finish_span(span, status_code)
|
33
|
+
if @assets_regex.nil? || !span.name.match?(@assets_regex)
|
34
|
+
span.set_http_status(status_code)
|
35
|
+
span.finish
|
36
|
+
end
|
37
|
+
end
|
17
38
|
end
|
18
39
|
end
|
19
40
|
end
|
@@ -2,7 +2,7 @@ module Sentry
|
|
2
2
|
class Configuration
|
3
3
|
attr_reader :rails
|
4
4
|
|
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
8
|
end
|
@@ -20,9 +20,9 @@ module Sentry
|
|
20
20
|
'ActionController::RoutingError',
|
21
21
|
'ActionController::UnknownAction',
|
22
22
|
'ActionController::UnknownFormat',
|
23
|
+
'ActionDispatch::Http::MimeNegotiation::InvalidType',
|
23
24
|
'ActionController::UnknownHttpMethod',
|
24
25
|
'ActionDispatch::Http::Parameters::ParseError',
|
25
|
-
'ActiveJob::DeserializationError', # Can cause infinite loops
|
26
26
|
'ActiveRecord::RecordNotFound'
|
27
27
|
].freeze
|
28
28
|
class Configuration
|
@@ -32,8 +32,14 @@ module Sentry
|
|
32
32
|
# will report exceptions even when they are rescued by these middlewares.
|
33
33
|
attr_accessor :report_rescued_exceptions
|
34
34
|
|
35
|
+
# Some adapters, like sidekiq, already have their own sentry integration.
|
36
|
+
# In those cases, we should skip ActiveJob's reporting to avoid duplicated reports.
|
37
|
+
attr_accessor :skippable_job_adapters
|
38
|
+
|
35
39
|
def initialize
|
36
40
|
@report_rescued_exceptions = true
|
41
|
+
# TODO: Remove this in 4.2.0
|
42
|
+
@skippable_job_adapters = []
|
37
43
|
end
|
38
44
|
end
|
39
45
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Sentry
|
2
|
+
module Rails
|
3
|
+
module Overrides
|
4
|
+
module FileHandler
|
5
|
+
def serve(*args)
|
6
|
+
if Sentry.initialized? && current_transaction = Sentry.get_current_scope.span
|
7
|
+
# we don't want to expose a setter for @sampled just for this case
|
8
|
+
current_transaction.instance_variable_set(:@sampled, false)
|
9
|
+
end
|
10
|
+
|
11
|
+
super
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/sentry/rails/railtie.rb
CHANGED
@@ -4,8 +4,8 @@ require "sentry/rails/rescued_exception_interceptor"
|
|
4
4
|
require "sentry/rails/backtrace_cleaner"
|
5
5
|
require "sentry/rails/controller_methods"
|
6
6
|
require "sentry/rails/controller_transaction"
|
7
|
-
require "sentry/rails/active_job"
|
8
7
|
require "sentry/rails/overrides/streaming_reporter"
|
8
|
+
require "sentry/rails/overrides/file_handler"
|
9
9
|
|
10
10
|
module Sentry
|
11
11
|
class Railtie < ::Rails::Railtie
|
@@ -17,23 +17,35 @@ module Sentry
|
|
17
17
|
app.config.middleware.use(Sentry::Rails::RescuedExceptionInterceptor)
|
18
18
|
end
|
19
19
|
|
20
|
-
config.after_initialize do
|
20
|
+
config.after_initialize do |app|
|
21
21
|
next unless Sentry.initialized?
|
22
22
|
|
23
|
+
configure_project_root
|
23
24
|
configure_sentry_logger
|
25
|
+
configure_trusted_proxies
|
24
26
|
extend_controller_methods
|
25
|
-
extend_active_job
|
27
|
+
extend_active_job if defined?(ActiveJob)
|
26
28
|
override_streaming_reporter
|
29
|
+
override_file_handler if app.config.public_file_server.enabled
|
27
30
|
setup_backtrace_cleanup_callback
|
28
31
|
inject_breadcrumbs_logger
|
29
32
|
activate_tracing
|
30
33
|
end
|
31
34
|
|
35
|
+
def configure_project_root
|
36
|
+
Sentry.configuration.project_root = ::Rails.root.to_s
|
37
|
+
end
|
38
|
+
|
32
39
|
def configure_sentry_logger
|
33
40
|
Sentry.configuration.logger = ::Rails.logger
|
34
41
|
end
|
35
42
|
|
43
|
+
def configure_trusted_proxies
|
44
|
+
Sentry.configuration.trusted_proxies += Array(::Rails.application.config.action_dispatch.trusted_proxies)
|
45
|
+
end
|
46
|
+
|
36
47
|
def extend_active_job
|
48
|
+
require "sentry/rails/active_job"
|
37
49
|
ActiveJob::Base.send(:prepend, Sentry::Rails::ActiveJobExtensions)
|
38
50
|
end
|
39
51
|
|
@@ -66,6 +78,12 @@ module Sentry
|
|
66
78
|
end
|
67
79
|
end
|
68
80
|
|
81
|
+
def override_file_handler
|
82
|
+
ActiveSupport.on_load :action_controller do
|
83
|
+
ActionDispatch::FileHandler.send(:prepend, Sentry::Rails::Overrides::FileHandler)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
69
87
|
def activate_tracing
|
70
88
|
if Sentry.configuration.tracing_enabled?
|
71
89
|
Sentry::Rails::Tracing.subscribe_tracing_events
|
@@ -11,6 +11,17 @@ module Sentry
|
|
11
11
|
begin
|
12
12
|
@app.call(env)
|
13
13
|
rescue => e
|
14
|
+
request = ActionDispatch::Request.new(env)
|
15
|
+
|
16
|
+
# Rails' ShowExceptions#render_exception will mutate env for the exceptions app
|
17
|
+
# so we need to hold a copy of env to report the accurate data (like request's url)
|
18
|
+
if request.show_exceptions?
|
19
|
+
scope = Sentry.get_current_scope
|
20
|
+
copied_env = scope.rack_env.dup
|
21
|
+
copied_env["sentry.original_transaction"] = scope.transaction_name
|
22
|
+
scope.set_rack_env(copied_env)
|
23
|
+
end
|
24
|
+
|
14
25
|
env["sentry.rescued_exception"] = e if Sentry.configuration.rails.report_rescued_exceptions
|
15
26
|
raise e
|
16
27
|
end
|
@@ -14,11 +14,11 @@ module Sentry
|
|
14
14
|
|
15
15
|
def subscribe_to_event(event_name)
|
16
16
|
if ::Rails.version.to_i == 5
|
17
|
-
ActiveSupport::Notifications.subscribe(event_name) do |
|
17
|
+
ActiveSupport::Notifications.subscribe(event_name) do |*args|
|
18
18
|
next unless Tracing.get_current_transaction
|
19
19
|
|
20
|
-
|
21
|
-
yield(event_name, duration, payload)
|
20
|
+
event = ActiveSupport::Notifications::Event.new(*args)
|
21
|
+
yield(event_name, event.duration, event.payload)
|
22
22
|
end
|
23
23
|
else
|
24
24
|
ActiveSupport::Notifications.subscribe(event_name) do |event|
|
@@ -2,19 +2,11 @@ module Sentry
|
|
2
2
|
module Rails
|
3
3
|
module Tracing
|
4
4
|
class ActionViewSubscriber < AbstractSubscriber
|
5
|
-
|
5
|
+
EVENT_NAME = "render_template.action_view".freeze
|
6
6
|
|
7
7
|
def self.subscribe!
|
8
|
-
|
9
|
-
|
10
|
-
record_on_current_span(op: event_name, start_timestamp: payload[:start_timestamp], description: payload[:identifier], duration: duration)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.unsubscribe!
|
16
|
-
EVENT_NAMES.each do |event_name|
|
17
|
-
ActiveSupport::Notifications.unsubscribe(event_name)
|
8
|
+
subscribe_to_event(EVENT_NAME) do |event_name, duration, payload|
|
9
|
+
record_on_current_span(op: event_name, start_timestamp: payload[:start_timestamp], description: payload[:identifier], duration: duration)
|
18
10
|
end
|
19
11
|
end
|
20
12
|
end
|
data/lib/sentry/rails/version.rb
CHANGED
data/sentry-rails.gemspec
CHANGED
@@ -16,12 +16,12 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
18
|
spec.metadata["source_code_uri"] = spec.homepage
|
19
|
-
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
|
19
|
+
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/sentry-rails/CHANGELOG.md"
|
20
20
|
|
21
21
|
spec.bindir = "exe"
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
25
|
spec.add_dependency "rails", ">= 5.0"
|
26
|
-
spec.add_dependency "sentry-ruby", "~> 4.
|
26
|
+
spec.add_dependency "sentry-ruby-core", "~> 4.2.0"
|
27
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1
|
4
|
+
version: 4.2.1
|
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-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -25,19 +25,19 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '5.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: sentry-ruby
|
28
|
+
name: sentry-ruby-core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.
|
33
|
+
version: 4.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.
|
40
|
+
version: 4.2.0
|
41
41
|
description: A gem that provides Rails integration for the Sentry error logger
|
42
42
|
email: accounts@sentry.io
|
43
43
|
executables: []
|
@@ -49,13 +49,14 @@ files:
|
|
49
49
|
- ".craft.yml"
|
50
50
|
- ".gitignore"
|
51
51
|
- ".rspec"
|
52
|
-
- ".travis.yml"
|
53
52
|
- CHANGELOG.md
|
54
53
|
- CODE_OF_CONDUCT.md
|
55
54
|
- Gemfile
|
56
55
|
- LICENSE.txt
|
56
|
+
- Makefile
|
57
57
|
- README.md
|
58
58
|
- Rakefile
|
59
|
+
- app/jobs/sentry/send_event_job.rb
|
59
60
|
- bin/console
|
60
61
|
- bin/setup
|
61
62
|
- lib/sentry-rails.rb
|
@@ -67,6 +68,8 @@ files:
|
|
67
68
|
- lib/sentry/rails/configuration.rb
|
68
69
|
- lib/sentry/rails/controller_methods.rb
|
69
70
|
- lib/sentry/rails/controller_transaction.rb
|
71
|
+
- lib/sentry/rails/engine.rb
|
72
|
+
- lib/sentry/rails/overrides/file_handler.rb
|
70
73
|
- lib/sentry/rails/overrides/streaming_reporter.rb
|
71
74
|
- lib/sentry/rails/railtie.rb
|
72
75
|
- lib/sentry/rails/rescued_exception_interceptor.rb
|
@@ -83,7 +86,7 @@ licenses:
|
|
83
86
|
metadata:
|
84
87
|
homepage_uri: https://github.com/getsentry/sentry-ruby
|
85
88
|
source_code_uri: https://github.com/getsentry/sentry-ruby
|
86
|
-
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md
|
89
|
+
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/master/sentry-rails/CHANGELOG.md
|
87
90
|
post_install_message:
|
88
91
|
rdoc_options: []
|
89
92
|
require_paths:
|