sentry-ruby 4.2.1 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -33
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7cdabfd3ae3762fc2940760298daa15499a136d1cd71cca9f4e0bb64e30ee68e
4
- data.tar.gz: 282e1a0bbfa3b45f5d4ecad1d8a30630e27b8d1eeb965a11eeaaf4dd110b70c6
3
+ metadata.gz: 2d155b5c7de2f02c985d3fb58851b865b912317effcb11575fcb0591162e476a
4
+ data.tar.gz: a021e74f77640a507c04c83476cdae19fc5938fba2ab02ddc2957e4c8abcc590
5
5
  SHA512:
6
- metadata.gz: 259c3b62a98ff599bb79f836ccf161149e4fe63da5e186f1d596c8e511d2861aeb197e57b9c142abc89171f4366ea70d4a5d0c489b0ff7c7bd9b935656eadc96
7
- data.tar.gz: 8d2feeec4eb23fd6fbf6090e7084494921365a3401a11ba5f6b5b8d9826d9199719bb80bbec1a048694cf1320fa9f389ce77969ff743320338645deb5b7f82c0
6
+ metadata.gz: 774ac5d839b028ee9889cce068cdde3dc8a5f34a32cb0db7582259ac805f4440003d188563bf00976a4a635bc3ef3610b746db63f298adca8600a682d3ab6f07
7
+ data.tar.gz: 3d29d303ab5c38cb0ea17d03c1e1e6287e5221fc4b34de33cdb21c2b3086ecafa60ba84112deb13f95af20d9966d91e6e1ff18800810b914b495fa3058b1df4b
data/README.md CHANGED
@@ -26,7 +26,7 @@ The official Ruby-language client and integration layer for the [Sentry](https:/
26
26
 
27
27
  ## Requirements
28
28
 
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.
29
+ We test on Ruby 2.4, 2.5, 2.6, 2.7, and 3.0 at the latest patchlevel/teeny version. We also support JRuby 9.0.
30
30
 
31
31
  If you use self-hosted Sentry, please also make sure its version is above `20.6.0`.
32
32
 
@@ -47,6 +47,7 @@ and depends on the integrations you want to have, you might also want to install
47
47
  ```ruby
48
48
  gem "sentry-rails"
49
49
  gem "sentry-sidekiq"
50
+ gem "sentry-delayed_job"
50
51
  # and mores to come in the future!
51
52
  ```
52
53
 
@@ -136,6 +137,7 @@ We also provide integrations with popular frameworks/libraries with the related
136
137
 
137
138
  - [sentry-rails](https://github.com/getsentry/sentry-ruby/tree/master/sentry-rails)
138
139
  - [sentry-sidekiq](https://github.com/getsentry/sentry-ruby/tree/master/sentry-sidekiq)
140
+ - [sentry-delayed_job](https://github.com/getsentry/sentry-ruby/tree/master/sentry-delayed_job)
139
141
 
140
142
  ### More configuration
141
143
 
@@ -143,38 +145,7 @@ You're all set - but there's a few more settings you may want to know about too!
143
145
 
144
146
  #### Blocking v.s. Non-blocking
145
147
 
146
- **Before version 4.1.0**, `sentry-ruby` sends every event immediately. But it can be configured to send asynchronously:
147
-
148
- ```ruby
149
- config.async = lambda { |event, hint|
150
- Thread.new { Sentry.send_event(event, hint) }
151
- }
152
- ```
153
-
154
- Using a thread to send events will be adequate for truly parallel Ruby platforms such as JRuby, though the benefit on MRI/CRuby will be limited. If the async callback raises an exception, Sentry will attempt to send synchronously.
155
-
156
- Note that the naive example implementation has a major drawback - it can create an infinite number of threads. We recommend creating a background job, using your background job processor, that will send Sentry notifications in the background.
157
-
158
- ```ruby
159
- config.async = lambda { |event, hint| SentryJob.perform_later(event, hint) }
160
-
161
- class SentryJob < ActiveJob::Base
162
- queue_as :default
163
- discard_on ActiveJob::DeserializationError # this will prevent infinite loop when there's an issue deserializing SentryJob
164
-
165
- def perform(event, hint)
166
- Sentry.send_event(event, hint)
167
- end
168
- end
169
- ```
170
-
171
- If you also use `sentry-rails`, you can directly use the job we defined for you:
172
-
173
- ```ruby
174
- config.async = lambda { |event, hint| Sentry::SendEventJob.perform_later(event, hint) }
175
- ```
176
-
177
- **After version 4.1.0**, `sentry-ruby` sends events asynchronously by default. The functionality works like this:
148
+ `sentry-ruby` sends events asynchronously by default. The functionality works like this:
178
149
 
179
150
  1. When the SDK is initialized, a `Sentry::BackgroundWorker` will be initialized too.
180
151
  2. When an event is passed to `Client#capture_event`, instead of sending it directly with `Client#send_event`, we'll let the worker do it.
@@ -208,6 +179,21 @@ If you want to send a particular event immediately, you can use event hints to d
208
179
  Sentry.capture_message("send me now!", hint: { background: false })
209
180
  ```
210
181
 
182
+ ##### `config.async`
183
+
184
+ You can also use `config.async` to send events with you own worker:
185
+
186
+ ```ruby
187
+ config.async = lambda { |event, hint| SentryJob.perform_later(event, hint) }
188
+ ```
189
+
190
+ And if you use `sentry-rails`, you can directly use the job we defined for you:
191
+
192
+ ```ruby
193
+ config.async = lambda { |event, hint| Sentry::SendEventJob.perform_later(event, hint) }
194
+ ```
195
+
196
+
211
197
  #### Contexts
212
198
 
213
199
  In sentry-ruby, every event will inherit their contextual data from the current scope. So you can enrich the event's data by configuring the current scope like:
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.2.1
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-09 00:00:00.000000000 Z
11
+ date: 2021-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sentry-ruby-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.2.1
19
+ version: 4.2.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.2.1
26
+ version: 4.2.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday
29
29
  requirement: !ruby/object:Gem::Requirement