sentry-rails 4.4.0.pre.beta.0 → 4.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1abbd4e00c660384cf961b09d8d8a2d98148336adf9ed7b766f73ca24c08cf33
4
- data.tar.gz: ca6bba663f5db7948e5078e77e38e7dbfb30bf9849c885fd5645a62e422bbb97
3
+ metadata.gz: 8a7b8db370fe88695dd0032b0bf07d2f141c317fe3fec1c94dc7bf1fbf57b323
4
+ data.tar.gz: 1794312779cea578d9ff93c75defe3769389f82a9d388fe18e51fc50da1f43db
5
5
  SHA512:
6
- metadata.gz: 2a05541ee2a1441ed70055b909d3c04b87b931df16c70e0c076d2ed44cda60146e1680c4326fb0e55a96dd598b1171cd4fcb6cbcaeab9110936c7a6a9048601b
7
- data.tar.gz: 9374e863588b2a926c05b8e2e0ed295d46813d9ebae9b98061e1dcc6329cb2ffcd3c617f66ef77e2c171e5a30c401fbefde0beed2717d382289bf2c161649fb2
6
+ metadata.gz: 5058cdfa95c51f36ed20d7cf06be1f1ca810d0befaa36c81f2d9aa7ed3c3e64015aa155712ad19d87cb67af91954380cf6bc59928a82f5419eb76d1546501060
7
+ data.tar.gz: dc0b6e407fcf3d64db76855c5e33b32ffd83080ad585f92ebdca7a2137909b34c80ef007c26c86eb3a0dfe2c58e9d74d61a1a94b704c1b2f36714a10732ea157
data/CHANGELOG.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Changelog
2
2
 
3
- ## 4.4.0-beta.0
3
+ Individual gem's changelog has been deprecated. Please check the [project changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md).
4
+
5
+ ## 4.4.0
4
6
 
5
7
  ### Features
6
8
 
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
- # TODO: Remove this if https://github.com/jruby/jruby/issues/6547 is addressed
29
- gem "i18n", "<= 1.8.7"
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
- IGNORED_DATA_TYPES = [:request, :headers, :exception, :exception_object]
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
@@ -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.delete(:headers)
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
@@ -1,5 +1,5 @@
1
1
  module Sentry
2
2
  module Rails
3
- VERSION = "4.4.0-beta.0"
3
+ VERSION = "4.5.2"
4
4
  end
5
5
  end
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/sentry-rails/CHANGELOG.md"
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.4.0.pre.beta"
26
+ spec.add_dependency "sentry-ruby-core", "~> 4.5.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.0.pre.beta.0
4
+ version: 4.5.2
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-04-27 00:00:00.000000000 Z
11
+ date: 2021-06-24 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.4.0.pre.beta
33
+ version: 4.5.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.4.0.pre.beta
40
+ version: 4.5.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/sentry-rails/CHANGELOG.md
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: 1.3.1
103
+ version: '0'
104
104
  requirements: []
105
- rubygems_version: 3.0.3.1
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