sentry-ruby 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +4 -0
- data/lib/sentry-ruby.rb +9 -0
- data/lib/sentry/event.rb +5 -5
- data/lib/sentry/rake.rb +17 -0
- data/lib/sentry/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 732989200a2cbf0a935c386cf84037d655332953ea2fef828099fbf68b756ab9
|
4
|
+
data.tar.gz: 4aecc66958496eede273d4cc4b2e3861e0ce7eb3cf769912a4a6675efeba693e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 798be41100ec3c8eb09039f9432df02fd0de323427fd0d8bf6d9ced8f7b39d420e972c6006bcb4490002e32f03acfad2311b8ddab826c6927bd53b2a7316c7cb
|
7
|
+
data.tar.gz: 78cc7ec6d5c1a7f6603f9f2e4917b26e12ad5b13c0387a00645282acf8c910518c4132c171e2c9a8311f11e82afa3eb0454d2102bf48abd4c44d6625fd4ce4cf
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 4.0.1
|
4
|
+
|
5
|
+
- Add rake integration: [1137](https://github.com/getsentry/sentry-ruby/pull/1137)
|
6
|
+
- Make Event's interfaces accessible: [1135](https://github.com/getsentry/sentry-ruby/pull/1135)
|
7
|
+
- ActiveSupportLogger should only record events that has a started time: [1132](https://github.com/getsentry/sentry-ruby/pull/1132)
|
8
|
+
|
3
9
|
## 4.0.0
|
4
10
|
|
5
11
|
- Only documents update for the official release and no API/feature changes.
|
data/README.md
CHANGED
@@ -28,6 +28,10 @@ The official Ruby-language client and integration layer for the [Sentry](https:/
|
|
28
28
|
|
29
29
|
We test on Ruby 2.4, 2.5, 2.6 and 2.7 at the latest patchlevel/teeny version. We also support JRuby 9.0.
|
30
30
|
|
31
|
+
## Migrate From sentry-raven
|
32
|
+
|
33
|
+
If you're using `sentry-raven`, we recommend you to migrate to this new SDK. You can find the benefits of migrating and how to do it in our [migration guide](https://docs.sentry.io/platforms/ruby/migration/).
|
34
|
+
|
31
35
|
## Getting Started
|
32
36
|
|
33
37
|
### Install
|
data/lib/sentry-ruby.rb
CHANGED
@@ -11,6 +11,15 @@ require "sentry/transaction"
|
|
11
11
|
require "sentry/hub"
|
12
12
|
require "sentry/rack"
|
13
13
|
|
14
|
+
def safely_require(lib)
|
15
|
+
begin
|
16
|
+
require lib
|
17
|
+
rescue LoadError
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
safely_require "sentry/rake"
|
22
|
+
|
14
23
|
module Sentry
|
15
24
|
class Error < StandardError
|
16
25
|
end
|
data/lib/sentry/event.rb
CHANGED
@@ -18,7 +18,7 @@ module Sentry
|
|
18
18
|
)
|
19
19
|
|
20
20
|
attr_accessor(*ATTRIBUTES)
|
21
|
-
attr_reader :configuration
|
21
|
+
attr_reader :configuration, :request, :exception, :stacktrace
|
22
22
|
|
23
23
|
def initialize(configuration:, message: nil)
|
24
24
|
# this needs to go first because some setters rely on configuration
|
@@ -75,7 +75,7 @@ module Sentry
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def rack_env=(env)
|
78
|
-
unless
|
78
|
+
unless request || env.empty?
|
79
79
|
@request = Sentry::RequestInterface.new.tap do |int|
|
80
80
|
int.from_rack(env)
|
81
81
|
end
|
@@ -96,9 +96,9 @@ module Sentry
|
|
96
96
|
def to_hash
|
97
97
|
data = serialize_attributes
|
98
98
|
data[:breadcrumbs] = breadcrumbs.to_hash if breadcrumbs
|
99
|
-
data[:stacktrace] =
|
100
|
-
data[:request] =
|
101
|
-
data[:exception] =
|
99
|
+
data[:stacktrace] = stacktrace.to_hash if stacktrace
|
100
|
+
data[:request] = request.to_hash if request
|
101
|
+
data[:exception] = exception.to_hash if exception
|
102
102
|
|
103
103
|
data
|
104
104
|
end
|
data/lib/sentry/rake.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "rake/task"
|
3
|
+
|
4
|
+
module Rake
|
5
|
+
class Application
|
6
|
+
alias orig_display_error_messsage display_error_message
|
7
|
+
def display_error_message(ex)
|
8
|
+
Sentry.capture_exception(ex) do |scope|
|
9
|
+
task_name = top_level_tasks.join(' ')
|
10
|
+
scope.set_transaction_name(task_name)
|
11
|
+
scope.set_tag("rake_task", task_name)
|
12
|
+
end
|
13
|
+
|
14
|
+
orig_display_error_messsage(ex)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/sentry/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.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: 2020-12-
|
11
|
+
date: 2020-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/sentry/rack.rb
|
68
68
|
- lib/sentry/rack/capture_exception.rb
|
69
69
|
- lib/sentry/rack/tracing.rb
|
70
|
+
- lib/sentry/rake.rb
|
70
71
|
- lib/sentry/scope.rb
|
71
72
|
- lib/sentry/span.rb
|
72
73
|
- lib/sentry/transaction.rb
|