sentry-ruby 4.0.0 → 4.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +78 -0
- data/Gemfile +2 -2
- data/README.md +49 -11
- data/lib/sentry-ruby.rb +40 -18
- data/lib/sentry/background_worker.rb +37 -0
- data/lib/sentry/backtrace.rb +3 -5
- data/lib/sentry/client.rb +26 -10
- data/lib/sentry/configuration.rb +14 -5
- data/lib/sentry/event.rb +27 -33
- data/lib/sentry/hub.rb +7 -7
- data/lib/sentry/integrable.rb +24 -0
- data/lib/sentry/interfaces/request.rb +50 -31
- data/lib/sentry/interfaces/stacktrace.rb +39 -6
- data/lib/sentry/rack.rb +2 -3
- data/lib/sentry/rack/capture_exceptions.rb +62 -0
- data/lib/sentry/rack/deprecations.rb +19 -0
- data/lib/sentry/rake.rb +17 -0
- data/lib/sentry/scope.rb +2 -2
- data/lib/sentry/span.rb +5 -28
- data/lib/sentry/transaction.rb +44 -0
- data/lib/sentry/transport.rb +12 -21
- data/lib/sentry/transport/http_transport.rb +3 -6
- data/lib/sentry/utils/request_id.rb +2 -2
- data/lib/sentry/version.rb +1 -1
- data/sentry-ruby.gemspec +1 -0
- metadata +27 -5
- data/lib/sentry/rack/capture_exception.rb +0 -45
- data/lib/sentry/rack/tracing.rb +0 -39
- data/lib/sentry/transport/state.rb +0 -40
@@ -1,40 +0,0 @@
|
|
1
|
-
module Sentry
|
2
|
-
class Transport
|
3
|
-
class State
|
4
|
-
def initialize
|
5
|
-
reset
|
6
|
-
end
|
7
|
-
|
8
|
-
def should_try?
|
9
|
-
return true if @status == :online
|
10
|
-
|
11
|
-
interval = @retry_after || [@retry_number, 6].min**2
|
12
|
-
return true if Sentry.utc_now - @last_check >= interval
|
13
|
-
|
14
|
-
false
|
15
|
-
end
|
16
|
-
|
17
|
-
def failure(retry_after = nil)
|
18
|
-
@status = :error
|
19
|
-
@retry_number += 1
|
20
|
-
@last_check = Sentry.utc_now
|
21
|
-
@retry_after = retry_after
|
22
|
-
end
|
23
|
-
|
24
|
-
def success
|
25
|
-
reset
|
26
|
-
end
|
27
|
-
|
28
|
-
def reset
|
29
|
-
@status = :online
|
30
|
-
@retry_number = 0
|
31
|
-
@last_check = nil
|
32
|
-
@retry_after = nil
|
33
|
-
end
|
34
|
-
|
35
|
-
def failed?
|
36
|
-
@status == :error
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|