sentry-rails 5.4.1 → 5.5.0

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: aa8698c9fc741267d62945d23aeb54d5e558a64cd0f818c9f724754107cac35e
4
- data.tar.gz: 6a3b1f71e222aea88ef9a50aabf739de21413ba1c943592ac7caf3145a0d84cd
3
+ metadata.gz: 9a4ffdc16721cf8bcce92afe2355c4f07a764db5dbff66142b784d8364321edf
4
+ data.tar.gz: 76a8a3a1575dca6197d90b30b93103a3aaa37eb1fa78ad4f669c8859e49da31c
5
5
  SHA512:
6
- metadata.gz: 55999e366e8d9b0eb977f77015940c1c88e3a6e629b4d4418060c0863f98a4e8a910686fa08d5f3fce5f726703811bdf778fd5c08460892d87209f4d6a3b95df
7
- data.tar.gz: 115f41de03b33a570d916605134b259c181173179d8c2942c7f8074d96f0d706469de2a9eeee99c02c0e316e2965943b628f6d47dd99bd02bacbda092a089ce4
6
+ metadata.gz: 1ec7bbefeb060dfb8c9c7b9a16e220396b5257fa18e91b32728c1f9ab9d7b724cb23a6ad2704a412c0451d36a390bc7f92b8cf1c1738dc87040b4d7fb5d0f772
7
+ data.tar.gz: 8e88a2891b5248c5e34a9ccf977575310ab88347fa3e1a13a23a9fa51c7fe89ef0bba72200417895ac9908c4b47fbef7a854dc8369cbbae973c15086a6de4355
@@ -13,8 +13,8 @@ module Sentry
13
13
  Sentry.with_scope do |scope|
14
14
  scope.set_rack_env(env)
15
15
  scope.set_context("action_cable", extra_context) if extra_context
16
- scope.set_transaction_name(transaction_name)
17
- transaction = start_transaction(env, scope.transaction_name)
16
+ scope.set_transaction_name(transaction_name, source: :view)
17
+ transaction = start_transaction(env, scope)
18
18
  scope.set_span(transaction) if transaction
19
19
 
20
20
  begin
@@ -29,10 +29,12 @@ module Sentry
29
29
  end
30
30
  end
31
31
 
32
- def start_transaction(env, transaction_name)
32
+ def start_transaction(env, scope)
33
33
  sentry_trace = env["HTTP_SENTRY_TRACE"]
34
- options = { name: transaction_name, op: "rails.action_cable".freeze }
35
- transaction = Sentry::Transaction.from_sentry_trace(sentry_trace, **options) if sentry_trace
34
+ baggage = env["HTTP_BAGGAGE"]
35
+
36
+ options = { name: scope.transaction_name, source: scope.transaction_source, op: "rails.action_cable".freeze }
37
+ transaction = Sentry::Transaction.from_sentry_trace(sentry_trace, baggage: baggage, **options) if sentry_trace
36
38
  Sentry.start_transaction(transaction: transaction, **options)
37
39
  end
38
40
 
@@ -20,12 +20,12 @@ module Sentry
20
20
  def record(job, &block)
21
21
  Sentry.with_scope do |scope|
22
22
  begin
23
- scope.set_transaction_name(job.class.name)
23
+ scope.set_transaction_name(job.class.name, source: :task)
24
24
  transaction =
25
25
  if job.is_a?(::Sentry::SendEventJob)
26
26
  nil
27
27
  else
28
- Sentry.start_transaction(name: scope.transaction_name, op: "active_job")
28
+ Sentry.start_transaction(name: scope.transaction_name, source: scope.transaction_source, op: "active_job")
29
29
  end
30
30
 
31
31
  scope.set_span(transaction) if transaction
@@ -25,13 +25,6 @@ module Sentry
25
25
 
26
26
  # the exception will be swallowed by ShowExceptions middleware
27
27
  return if request.show_exceptions? && !Sentry.configuration.rails.report_rescued_exceptions
28
-
29
- current_scope = Sentry.get_current_scope
30
-
31
- if original_transaction = env["sentry.original_transaction"]
32
- current_scope.set_transaction_name(original_transaction)
33
- end
34
-
35
28
  Sentry::Rails.capture_exception(exception).tap do |event|
36
29
  env[ERROR_EVENT_ID_KEY] = event.event_id if event
37
30
  end
@@ -39,13 +32,15 @@ module Sentry
39
32
 
40
33
  def start_transaction(env, scope)
41
34
  sentry_trace = env["HTTP_SENTRY_TRACE"]
42
- options = { name: scope.transaction_name, op: transaction_op }
35
+ baggage = env["HTTP_BAGGAGE"]
36
+
37
+ options = { name: scope.transaction_name, source: scope.transaction_source, op: transaction_op }
43
38
 
44
39
  if @assets_regex && scope.transaction_name.match?(@assets_regex)
45
40
  options.merge!(sampled: false)
46
41
  end
47
42
 
48
- transaction = Sentry::Transaction.from_sentry_trace(sentry_trace, **options) if sentry_trace
43
+ transaction = Sentry::Transaction.from_sentry_trace(sentry_trace, baggage: baggage, **options) if sentry_trace
49
44
  Sentry.start_transaction(transaction: transaction, custom_sampling_context: { env: env }, **options)
50
45
  end
51
46
  end
@@ -3,7 +3,7 @@ module Sentry
3
3
  module ControllerTransaction
4
4
  def self.included(base)
5
5
  base.prepend_before_action do |controller|
6
- Sentry.get_current_scope.set_transaction_name("#{controller.class}##{controller.action_name}")
6
+ Sentry.get_current_scope.set_transaction_name("#{controller.class}##{controller.action_name}", source: :view)
7
7
  end
8
8
  end
9
9
  end
@@ -1,7 +1,8 @@
1
1
  module Sentry
2
2
  module Rails
3
3
  # This is not a user-facing class. You should use it with Rails 7.0's error reporter feature and its interfaces.
4
- # See https://github.com/rails/rails/blob/main/activesupport/lib/active_support/error_reporter.rb for more information.
4
+ # See https://github.com/rails/rails/blob/main/activesupport/lib/active_support/error_reporter.rb to learn more about reporting APIs.
5
+ # If you want Sentry to subscribe to the error reporter, please set `config.rails.register_error_subscriber` to `true`.
5
6
  class ErrorSubscriber
6
7
  SKIP_SOURCES = Regexp.union([/.*_cache_store.active_support/])
7
8
 
@@ -1,5 +1,5 @@
1
1
  module Sentry
2
2
  module Rails
3
- VERSION = "5.4.1"
3
+ VERSION = "5.5.0"
4
4
  end
5
5
  end
data/sentry-rails.gemspec CHANGED
@@ -23,5 +23,5 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ["lib"]
24
24
 
25
25
  spec.add_dependency "railties", ">= 5.0"
26
- spec.add_dependency "sentry-ruby", "~> 5.4.1"
26
+ spec.add_dependency "sentry-ruby", "~> 5.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: 5.4.1
4
+ version: 5.5.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: 2022-07-26 00:00:00.000000000 Z
11
+ date: 2022-10-03 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: 5.4.1
33
+ version: 5.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: 5.4.1
40
+ version: 5.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: []