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 +4 -4
- data/lib/sentry/rails/action_cable.rb +7 -5
- data/lib/sentry/rails/active_job.rb +2 -2
- data/lib/sentry/rails/capture_exceptions.rb +4 -9
- data/lib/sentry/rails/controller_transaction.rb +1 -1
- data/lib/sentry/rails/error_subscriber.rb +2 -1
- data/lib/sentry/rails/version.rb +1 -1
- data/sentry-rails.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a4ffdc16721cf8bcce92afe2355c4f07a764db5dbff66142b784d8364321edf
|
4
|
+
data.tar.gz: 76a8a3a1575dca6197d90b30b93103a3aaa37eb1fa78ad4f669c8859e49da31c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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,
|
32
|
+
def start_transaction(env, scope)
|
33
33
|
sentry_trace = env["HTTP_SENTRY_TRACE"]
|
34
|
-
|
35
|
-
|
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
|
-
|
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
|
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
|
|
data/lib/sentry/rails/version.rb
CHANGED
data/sentry-rails.gemspec
CHANGED
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
|
+
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-
|
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.
|
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.
|
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: []
|