sentry-rails 4.4.0 → 4.6.0.pre.beta.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/Gemfile +5 -7
- data/lib/sentry/rails/breadcrumb/active_support_logger.rb +3 -7
- data/lib/sentry/rails/instrument_payload_cleanup_helper.rb +13 -0
- data/lib/sentry/rails/railtie.rb +12 -1
- data/lib/sentry/rails/tracing/action_controller_subscriber.rb +4 -2
- data/lib/sentry/rails/version.rb +1 -1
- data/sentry-rails.gemspec +2 -2
- metadata +9 -9
- data/.craft.yml +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b02dcbac481eb6e645780e3ff882455937d1d2815f3e9bd63670591a7492c350
|
4
|
+
data.tar.gz: c4be21017ce59812b637409e0066ff2059341d63995f1ae5a5c69ea38653c667
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f407319c4aa281023c0ffc87d84ea0c947a0d603178092a9a81d9d4ea11df7d5819f0d1c1a1b5daca4e4d00a79ffad137ee2f67917ef7f2edeede525e353d93
|
7
|
+
data.tar.gz: abf841e66f24360dbdf5e364bdac989403ed6c06373dab404c17a8c3da24098773f6740f92ea722ca8990f27e5f26af36ff958e3f5421dd8bec6d7cf3cfef059
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -2,6 +2,7 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in sentry-ruby.gemspec
|
4
4
|
gemspec
|
5
|
+
gem "sentry-ruby", path: "../sentry-ruby"
|
5
6
|
|
6
7
|
rails_version = ENV["RAILS_VERSION"]
|
7
8
|
rails_version = "6.1.0" if rails_version.nil?
|
@@ -18,6 +19,8 @@ end
|
|
18
19
|
gem "rails", "~> #{rails_version}"
|
19
20
|
gem "sprockets-rails"
|
20
21
|
|
22
|
+
gem "sidekiq"
|
23
|
+
|
21
24
|
gem "rspec", "~> 3.0"
|
22
25
|
gem "rspec-retry"
|
23
26
|
gem "rspec-rails", "~> 4.0"
|
@@ -25,13 +28,8 @@ gem "codecov", "0.2.12"
|
|
25
28
|
|
26
29
|
gem "rake", "~> 12.0"
|
27
30
|
|
28
|
-
|
29
|
-
gem "
|
30
|
-
|
31
|
-
gem "sidekiq"
|
32
|
-
|
33
|
-
gem "sentry-ruby", path: "../sentry-ruby"
|
34
|
-
|
31
|
+
gem "object_tracer"
|
32
|
+
gem "debug", github: "ruby/debug" if RUBY_VERSION.to_f >= 2.6
|
35
33
|
gem "pry"
|
36
34
|
|
37
35
|
gem "benchmark-ips"
|
@@ -1,9 +1,11 @@
|
|
1
|
+
require "sentry/rails/instrument_payload_cleanup_helper"
|
2
|
+
|
1
3
|
module Sentry
|
2
4
|
module Rails
|
3
5
|
module Breadcrumb
|
4
6
|
module ActiveSupportLogger
|
5
7
|
class << self
|
6
|
-
|
8
|
+
include InstrumentPayloadCleanupHelper
|
7
9
|
|
8
10
|
def add(name, started, _finished, _unique_id, data)
|
9
11
|
# skip Rails' internal events
|
@@ -23,12 +25,6 @@ module Sentry
|
|
23
25
|
Sentry.add_breadcrumb(crumb)
|
24
26
|
end
|
25
27
|
|
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
|
-
|
32
28
|
def inject
|
33
29
|
@subscriber = ::ActiveSupport::Notifications.subscribe(/.*/) do |name, started, finished, unique_id, data|
|
34
30
|
# we only record events that has a started timestamp
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Sentry
|
2
|
+
module Rails
|
3
|
+
module InstrumentPayloadCleanupHelper
|
4
|
+
IGNORED_DATA_TYPES = [:request, :response, :headers, :exception, :exception_object]
|
5
|
+
|
6
|
+
def cleanup_data(data)
|
7
|
+
IGNORED_DATA_TYPES.each do |key|
|
8
|
+
data.delete(key) if data.key?(key)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/sentry/rails/railtie.rb
CHANGED
@@ -12,13 +12,19 @@ module Sentry
|
|
12
12
|
app.config.middleware.use(Sentry::Rails::RescuedExceptionInterceptor)
|
13
13
|
end
|
14
14
|
|
15
|
+
# because the extension works by registering the around_perform callcack, it should always be ran
|
16
|
+
# before the application is eager-loaded (before user's jobs register their own callbacks)
|
17
|
+
# See https://github.com/getsentry/sentry-ruby/issues/1249#issuecomment-853871871 for the detail explanation
|
18
|
+
initializer "sentry.extend_active_job", before: :eager_load! do |app|
|
19
|
+
extend_active_job if defined?(ActiveJob)
|
20
|
+
end
|
21
|
+
|
15
22
|
config.after_initialize do |app|
|
16
23
|
next unless Sentry.initialized?
|
17
24
|
|
18
25
|
configure_project_root
|
19
26
|
configure_trusted_proxies
|
20
27
|
extend_controller_methods if defined?(ActionController)
|
21
|
-
extend_active_job if defined?(ActiveJob)
|
22
28
|
patch_background_worker if defined?(ActiveRecord)
|
23
29
|
override_streaming_reporter if defined?(ActionView)
|
24
30
|
setup_backtrace_cleanup_callback
|
@@ -26,6 +32,11 @@ module Sentry
|
|
26
32
|
activate_tracing
|
27
33
|
end
|
28
34
|
|
35
|
+
runner do
|
36
|
+
next unless Sentry.initialized?
|
37
|
+
Sentry.configuration.background_worker_threads = 0
|
38
|
+
end
|
39
|
+
|
29
40
|
def configure_project_root
|
30
41
|
Sentry.configuration.project_root = ::Rails.root.to_s
|
31
42
|
end
|
@@ -1,9 +1,12 @@
|
|
1
1
|
require "sentry/rails/tracing/abstract_subscriber"
|
2
|
+
require "sentry/rails/instrument_payload_cleanup_helper"
|
2
3
|
|
3
4
|
module Sentry
|
4
5
|
module Rails
|
5
6
|
module Tracing
|
6
7
|
class ActionControllerSubscriber < AbstractSubscriber
|
8
|
+
extend InstrumentPayloadCleanupHelper
|
9
|
+
|
7
10
|
EVENT_NAME = "process_action.action_controller".freeze
|
8
11
|
|
9
12
|
def self.subscribe!
|
@@ -18,8 +21,7 @@ module Sentry
|
|
18
21
|
duration: duration
|
19
22
|
) do |span|
|
20
23
|
payload = payload.dup
|
21
|
-
payload
|
22
|
-
payload.delete(:request)
|
24
|
+
cleanup_data(payload)
|
23
25
|
span.set_data(:payload, payload)
|
24
26
|
span.set_http_status(payload[:status])
|
25
27
|
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/
|
19
|
+
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/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 "railties", ">= 5.0"
|
26
|
-
spec.add_dependency "sentry-ruby-core", "~> 4.
|
26
|
+
spec.add_dependency "sentry-ruby-core", "~> 4.6.0-beta.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.
|
4
|
+
version: 4.6.0.pre.beta.0
|
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-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.
|
33
|
+
version: 4.6.0.pre.beta.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.6.0.pre.beta.0
|
41
41
|
description: A gem that provides Rails integration for the Sentry error logger
|
42
42
|
email: accounts@sentry.io
|
43
43
|
executables: []
|
@@ -46,7 +46,6 @@ extra_rdoc_files:
|
|
46
46
|
- README.md
|
47
47
|
- LICENSE.txt
|
48
48
|
files:
|
49
|
-
- ".craft.yml"
|
50
49
|
- ".gitignore"
|
51
50
|
- ".rspec"
|
52
51
|
- CHANGELOG.md
|
@@ -70,6 +69,7 @@ files:
|
|
70
69
|
- lib/sentry/rails/controller_methods.rb
|
71
70
|
- lib/sentry/rails/controller_transaction.rb
|
72
71
|
- lib/sentry/rails/engine.rb
|
72
|
+
- lib/sentry/rails/instrument_payload_cleanup_helper.rb
|
73
73
|
- lib/sentry/rails/overrides/streaming_reporter.rb
|
74
74
|
- lib/sentry/rails/railtie.rb
|
75
75
|
- lib/sentry/rails/rescued_exception_interceptor.rb
|
@@ -86,7 +86,7 @@ licenses:
|
|
86
86
|
metadata:
|
87
87
|
homepage_uri: https://github.com/getsentry/sentry-ruby
|
88
88
|
source_code_uri: https://github.com/getsentry/sentry-ruby
|
89
|
-
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/master/
|
89
|
+
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md
|
90
90
|
post_install_message:
|
91
91
|
rdoc_options: []
|
92
92
|
require_paths:
|
@@ -98,11 +98,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
98
98
|
version: '2.4'
|
99
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 1.3.1
|
104
104
|
requirements: []
|
105
|
-
rubygems_version: 3.
|
105
|
+
rubygems_version: 3.1.6
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
108
|
summary: A gem that provides Rails integration for the Sentry error logger
|
data/.craft.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
minVersion: '0.13.2'
|
2
|
-
github:
|
3
|
-
owner: getsentry
|
4
|
-
repo: sentry-ruby
|
5
|
-
changelogPolicy: simple
|
6
|
-
preReleaseCommand: ruby ../.scripts/bump-version.rb
|
7
|
-
releaseBranchPrefix: release-sentry-rails
|
8
|
-
statusProvider:
|
9
|
-
name: github
|
10
|
-
artifactProvider:
|
11
|
-
name: github
|
12
|
-
targets:
|
13
|
-
- name: gem
|
14
|
-
- name: registry
|
15
|
-
type: sdk
|
16
|
-
config:
|
17
|
-
canonical: 'gem:sentry-rails'
|
18
|
-
- name: github
|
19
|
-
tagPrefix: sentry-rails-v
|
20
|
-
changelog: sentry-rails/CHANGELOG.md
|