sentry-ruby 6.6.2 → 6.7.0
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.
- checksums.yaml +4 -4
- data/bin/test +15 -0
- data/gemfiles/ruby-2.7_rack-2_redis-4.gemfile.lock +159 -0
- data/gemfiles/ruby-2.7_rack-3.1_redis-4.gemfile.lock +159 -0
- data/gemfiles/ruby-2.7_rack-3_redis-4.gemfile.lock +159 -0
- data/gemfiles/ruby-3.0_rack-2_redis-4.gemfile.lock +173 -0
- data/gemfiles/ruby-3.0_rack-3.1_redis-4.gemfile.lock +173 -0
- data/gemfiles/ruby-3.0_rack-3_redis-4.gemfile.lock +173 -0
- data/gemfiles/ruby-3.1_rack-2_redis-4.gemfile.lock +241 -0
- data/gemfiles/ruby-3.1_rack-3.1_redis-4.gemfile.lock +241 -0
- data/gemfiles/ruby-3.1_rack-3_redis-4.gemfile.lock +241 -0
- data/gemfiles/ruby-3.2_rack-0_redis-5.gemfile.lock +263 -0
- data/gemfiles/ruby-3.2_rack-2_redis-4.gemfile.lock +260 -0
- data/gemfiles/ruby-3.2_rack-2_redis-5.gemfile.lock +266 -0
- data/gemfiles/ruby-3.2_rack-3.1_redis-4.gemfile.lock +260 -0
- data/gemfiles/ruby-3.2_rack-3_redis-4.gemfile.lock +260 -0
- data/gemfiles/ruby-3.2_rack-3_redis-5.gemfile.lock +266 -0
- data/gemfiles/ruby-3.3_rack-2_redis-4.gemfile.lock +263 -0
- data/gemfiles/ruby-3.3_rack-3.1_redis-4.gemfile.lock +263 -0
- data/gemfiles/ruby-3.3_rack-3.1_redis-5.3.gemfile.lock +269 -0
- data/gemfiles/ruby-3.3_rack-3_redis-4.gemfile.lock +263 -0
- data/gemfiles/ruby-3.4_rack-2_redis-4.gemfile.lock +254 -0
- data/gemfiles/ruby-3.4_rack-3.1_redis-4.gemfile.lock +254 -0
- data/gemfiles/ruby-3.4_rack-3.1_redis-5.3.gemfile.lock +260 -0
- data/gemfiles/ruby-3.4_rack-3_redis-4.gemfile.lock +254 -0
- data/gemfiles/ruby-4.0_rack-2_redis-4.gemfile.lock +254 -0
- data/gemfiles/ruby-4.0_rack-3.1_redis-4.gemfile.lock +254 -0
- data/gemfiles/ruby-4.0_rack-3_redis-4.gemfile.lock +254 -0
- data/gemfiles/ruby-jruby-9.4.14.0_rack-2_redis-4.gemfile.lock +266 -0
- data/gemfiles/ruby-jruby-9.4.14.0_rack-3.1_redis-4.gemfile.lock +266 -0
- data/gemfiles/ruby-jruby-9.4.14.0_rack-3_redis-4.gemfile.lock +266 -0
- data/lib/sentry/client.rb +7 -2
- data/lib/sentry/configuration.rb +40 -0
- data/lib/sentry/envelope/item.rb +21 -0
- data/lib/sentry/scope.rb +42 -3
- data/lib/sentry/span.rb +1 -0
- data/lib/sentry/telemetry_event_buffer.rb +9 -2
- data/lib/sentry/test_helper.rb +6 -3
- data/lib/sentry/threaded_periodic_worker.rb +8 -3
- data/lib/sentry/transport.rb +14 -3
- data/lib/sentry/utils/telemetry_attributes.rb +26 -14
- data/lib/sentry/version.rb +1 -1
- data/lib/sentry-ruby.rb +90 -5
- data/sentry-ruby-core.gemspec +1 -1
- data/sentry-ruby.gemspec +1 -1
- metadata +36 -6
data/lib/sentry/scope.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "set"
|
|
3
4
|
require "sentry/breadcrumb_buffer"
|
|
4
5
|
require "sentry/propagation_context"
|
|
5
6
|
require "sentry/attachment"
|
|
@@ -24,7 +25,8 @@ module Sentry
|
|
|
24
25
|
:span,
|
|
25
26
|
:session,
|
|
26
27
|
:attachments,
|
|
27
|
-
:propagation_context
|
|
28
|
+
:propagation_context,
|
|
29
|
+
:attributes
|
|
28
30
|
]
|
|
29
31
|
|
|
30
32
|
attr_reader(*ATTRIBUTES)
|
|
@@ -84,7 +86,15 @@ module Sentry
|
|
|
84
86
|
# @param telemetry [MetricEvent, LogEvent] the telemetry event to apply scope context to
|
|
85
87
|
# @return [MetricEvent, LogEvent] the telemetry event with scope context applied
|
|
86
88
|
def apply_to_telemetry(telemetry)
|
|
87
|
-
#
|
|
89
|
+
# Compare as strings since String and Symbol keys serialize to the same wire key.
|
|
90
|
+
existing_keys = telemetry.attributes.keys.map(&:to_s).to_set
|
|
91
|
+
|
|
92
|
+
attributes.each do |key, value|
|
|
93
|
+
next if existing_keys.include?(key)
|
|
94
|
+
|
|
95
|
+
telemetry.attributes[key] = value
|
|
96
|
+
end
|
|
97
|
+
|
|
88
98
|
trace_context = get_trace_context
|
|
89
99
|
telemetry.trace_id = trace_context[:trace_id]
|
|
90
100
|
telemetry.span_id = trace_context[:span_id]
|
|
@@ -136,6 +146,7 @@ module Sentry
|
|
|
136
146
|
copy.propagation_context = propagation_context.deep_dup
|
|
137
147
|
copy.attachments = attachments.dup
|
|
138
148
|
copy.event_processors = event_processors.dup
|
|
149
|
+
copy.attributes = attributes.deep_dup
|
|
139
150
|
copy
|
|
140
151
|
end
|
|
141
152
|
|
|
@@ -154,11 +165,12 @@ module Sentry
|
|
|
154
165
|
self.span = scope.span
|
|
155
166
|
self.propagation_context = scope.propagation_context
|
|
156
167
|
self.attachments = scope.attachments
|
|
168
|
+
self.attributes = scope.attributes
|
|
157
169
|
end
|
|
158
170
|
|
|
159
171
|
# Updates the scope's data from the given options.
|
|
160
172
|
# @param contexts [Hash]
|
|
161
|
-
# @param
|
|
173
|
+
# @param extra [Hash]
|
|
162
174
|
# @param tags [Hash]
|
|
163
175
|
# @param user [Hash]
|
|
164
176
|
# @param level [String, Symbol]
|
|
@@ -256,6 +268,32 @@ module Sentry
|
|
|
256
268
|
set_contexts(key => value)
|
|
257
269
|
end
|
|
258
270
|
|
|
271
|
+
# Updates the scope's attributes by merging with the old value.
|
|
272
|
+
# @param attributes_hash [Hash]
|
|
273
|
+
# @return [Hash]
|
|
274
|
+
def set_attributes(attributes_hash)
|
|
275
|
+
check_argument_type!(attributes_hash, Hash)
|
|
276
|
+
attributes_hash.each { |key, value| @attributes[key.to_s] = value }
|
|
277
|
+
@attributes
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# Sets a single attribute on the scope.
|
|
281
|
+
# @param key [String, Symbol]
|
|
282
|
+
# @param value [Object]
|
|
283
|
+
# @param unit [String, Symbol, nil] an optional measurement unit for the value
|
|
284
|
+
# @return [Hash]
|
|
285
|
+
def set_attribute(key, value, unit: nil)
|
|
286
|
+
value = { value: value, unit: unit } unless unit.nil?
|
|
287
|
+
set_attributes(key => value)
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
# Removes a single attribute from the scope. No-op if the attribute is not set.
|
|
291
|
+
# @param key [String, Symbol]
|
|
292
|
+
# @return [void]
|
|
293
|
+
def remove_attribute(key)
|
|
294
|
+
@attributes.delete(key.to_s)
|
|
295
|
+
end
|
|
296
|
+
|
|
259
297
|
# Sets the scope's level attribute.
|
|
260
298
|
# @param level [String, Symbol]
|
|
261
299
|
# @return [void]
|
|
@@ -361,6 +399,7 @@ module Sentry
|
|
|
361
399
|
@span = nil
|
|
362
400
|
@session = nil
|
|
363
401
|
@attachments = []
|
|
402
|
+
@attributes = {}
|
|
364
403
|
generate_propagation_context
|
|
365
404
|
set_new_breadcrumb_buffer
|
|
366
405
|
end
|
data/lib/sentry/span.rb
CHANGED
|
@@ -45,6 +45,7 @@ module Sentry
|
|
|
45
45
|
FUNCTION = "code.function"
|
|
46
46
|
NAMESPACE = "code.namespace"
|
|
47
47
|
|
|
48
|
+
MESSAGING_SYSTEM = "messaging.system"
|
|
48
49
|
MESSAGING_MESSAGE_ID = "messaging.message.id"
|
|
49
50
|
MESSAGING_DESTINATION_NAME = "messaging.destination.name"
|
|
50
51
|
MESSAGING_MESSAGE_RECEIVE_LATENCY = "messaging.message.receive.latency"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "json"
|
|
3
4
|
require "sentry/threaded_periodic_worker"
|
|
4
5
|
require "sentry/envelope"
|
|
5
6
|
|
|
@@ -58,7 +59,11 @@ module Sentry
|
|
|
58
59
|
|
|
59
60
|
if size >= @max_items_before_drop
|
|
60
61
|
log_debug("[#{self.class}] exceeded max capacity, dropping event")
|
|
61
|
-
@client.transport.record_lost_event(
|
|
62
|
+
@client.transport.record_lost_event(
|
|
63
|
+
:queue_overflow,
|
|
64
|
+
@data_category,
|
|
65
|
+
num_bytes: JSON.generate(item.to_h).bytesize
|
|
66
|
+
)
|
|
62
67
|
else
|
|
63
68
|
@pending_items << item
|
|
64
69
|
end
|
|
@@ -92,6 +97,7 @@ module Sentry
|
|
|
92
97
|
)
|
|
93
98
|
|
|
94
99
|
discarded_count = 0
|
|
100
|
+
discarded_bytes = 0
|
|
95
101
|
envelope_items = []
|
|
96
102
|
|
|
97
103
|
if @before_send
|
|
@@ -102,6 +108,7 @@ module Sentry
|
|
|
102
108
|
envelope_items << processed_item.to_h
|
|
103
109
|
else
|
|
104
110
|
discarded_count += 1
|
|
111
|
+
discarded_bytes += JSON.generate(item.to_h).bytesize
|
|
105
112
|
end
|
|
106
113
|
end
|
|
107
114
|
else
|
|
@@ -109,7 +116,7 @@ module Sentry
|
|
|
109
116
|
end
|
|
110
117
|
|
|
111
118
|
unless discarded_count.zero?
|
|
112
|
-
@client.transport.record_lost_event(:before_send, @data_category, num: discarded_count)
|
|
119
|
+
@client.transport.record_lost_event(:before_send, @data_category, num: discarded_count, num_bytes: discarded_bytes)
|
|
113
120
|
end
|
|
114
121
|
|
|
115
122
|
return if envelope_items.empty?
|
data/lib/sentry/test_helper.rb
CHANGED
|
@@ -52,10 +52,10 @@ module Sentry
|
|
|
52
52
|
test_client = Sentry::Client.new(dummy_config.dup)
|
|
53
53
|
main_hub.bind_client(test_client)
|
|
54
54
|
|
|
55
|
-
# Realign the current
|
|
55
|
+
# Realign the current execution context's hub with the main hub so direct
|
|
56
56
|
# `sentry_events` reads and any hub the Rack middleware clones from the
|
|
57
57
|
# main hub all observe the same DummyTransport.
|
|
58
|
-
|
|
58
|
+
Sentry.set_current_hub_internal(main_hub)
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
# Clears all stored events and envelopes.
|
|
@@ -159,10 +159,13 @@ module Sentry
|
|
|
159
159
|
# Don't check initialized? because sometimes we stub it in tests
|
|
160
160
|
if Sentry.instance_variable_defined?(:@main_hub)
|
|
161
161
|
Sentry::GLOBALS.each do |var|
|
|
162
|
+
worker = Sentry.instance_variable_get(:"@#{var}")
|
|
163
|
+
worker.kill if worker.respond_to?(:kill)
|
|
164
|
+
|
|
162
165
|
Sentry.instance_variable_set(:"@#{var}", nil)
|
|
163
166
|
end
|
|
164
167
|
|
|
165
|
-
|
|
168
|
+
Sentry.set_current_hub_internal(nil)
|
|
166
169
|
end
|
|
167
170
|
end
|
|
168
171
|
end
|
|
@@ -30,10 +30,15 @@ module Sentry
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def kill
|
|
33
|
-
log_debug("[#{self.class.name}] thread killed")
|
|
34
|
-
|
|
35
33
|
@exited = true
|
|
36
|
-
|
|
34
|
+
|
|
35
|
+
# Only a started worker has a thread to kill (and to log about).
|
|
36
|
+
# Guarding here keeps a never-started worker's teardown silent, so
|
|
37
|
+
# killing one during test reset can't emit a stray debug line.
|
|
38
|
+
return unless @thread
|
|
39
|
+
|
|
40
|
+
log_debug("[#{self.class.name}] thread killed")
|
|
41
|
+
@thread.kill
|
|
37
42
|
end
|
|
38
43
|
end
|
|
39
44
|
end
|
data/lib/sentry/transport.rb
CHANGED
|
@@ -64,7 +64,7 @@ module Sentry
|
|
|
64
64
|
end
|
|
65
65
|
rescue Sentry::SizeExceededError
|
|
66
66
|
serialized_items&.each do |item|
|
|
67
|
-
record_lost_event(:send_error, item.data_category)
|
|
67
|
+
record_lost_event(:send_error, item.data_category, num: item.item_count, num_bytes: item.lost_event_byte_size)
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
|
|
@@ -167,11 +167,16 @@ module Sentry
|
|
|
167
167
|
envelope
|
|
168
168
|
end
|
|
169
169
|
|
|
170
|
-
def record_lost_event(reason, data_category, num: 1)
|
|
170
|
+
def record_lost_event(reason, data_category, num: 1, num_bytes: nil)
|
|
171
171
|
return unless @send_client_reports
|
|
172
172
|
return unless CLIENT_REPORT_REASONS.include?(reason)
|
|
173
173
|
|
|
174
174
|
@discarded_events[[reason, data_category]] += num
|
|
175
|
+
|
|
176
|
+
return unless num_bytes
|
|
177
|
+
|
|
178
|
+
byte_category = Envelope::Item.byte_data_category(data_category)
|
|
179
|
+
@discarded_events[[reason, byte_category]] += num_bytes if byte_category
|
|
175
180
|
end
|
|
176
181
|
|
|
177
182
|
def flush
|
|
@@ -211,7 +216,13 @@ module Sentry
|
|
|
211
216
|
envelope.items.reject! do |item|
|
|
212
217
|
if is_rate_limited?(item.data_category)
|
|
213
218
|
log_debug("[Transport] Envelope item [#{item.type}] not sent: rate limiting")
|
|
214
|
-
|
|
219
|
+
|
|
220
|
+
record_lost_event(
|
|
221
|
+
:ratelimit_backoff,
|
|
222
|
+
item.data_category,
|
|
223
|
+
num: item.item_count,
|
|
224
|
+
num_bytes: item.lost_event_byte_size
|
|
225
|
+
)
|
|
215
226
|
|
|
216
227
|
true
|
|
217
228
|
else
|
|
@@ -7,23 +7,35 @@ module Sentry
|
|
|
7
7
|
module TelemetryAttributes
|
|
8
8
|
private
|
|
9
9
|
|
|
10
|
-
def attribute_hash(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
when TrueClass, FalseClass
|
|
15
|
-
{ value: value, type: "boolean" }
|
|
16
|
-
when Integer
|
|
17
|
-
{ value: value, type: "integer" }
|
|
18
|
-
when Float
|
|
19
|
-
{ value: value, type: "double" }
|
|
10
|
+
def attribute_hash(raw_value)
|
|
11
|
+
if raw_value.is_a?(Hash) && (raw_value.key?(:value) || raw_value.key?("value"))
|
|
12
|
+
value = raw_value.key?(:value) ? raw_value[:value] : raw_value["value"]
|
|
13
|
+
unit = raw_value.key?(:unit) ? raw_value[:unit] : raw_value["unit"]
|
|
20
14
|
else
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
value = raw_value
|
|
16
|
+
unit = nil
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
result =
|
|
20
|
+
case value
|
|
21
|
+
when String
|
|
24
22
|
{ value: value, type: "string" }
|
|
23
|
+
when TrueClass, FalseClass
|
|
24
|
+
{ value: value, type: "boolean" }
|
|
25
|
+
when Integer
|
|
26
|
+
{ value: value, type: "integer" }
|
|
27
|
+
when Float
|
|
28
|
+
{ value: value, type: "double" }
|
|
29
|
+
else
|
|
30
|
+
begin
|
|
31
|
+
{ value: JSON.generate(value), type: "string" }
|
|
32
|
+
rescue
|
|
33
|
+
{ value: value, type: "string" }
|
|
34
|
+
end
|
|
25
35
|
end
|
|
26
|
-
|
|
36
|
+
|
|
37
|
+
result[:unit] = unit.to_s if unit.is_a?(String) || unit.is_a?(Symbol)
|
|
38
|
+
result
|
|
27
39
|
end
|
|
28
40
|
end
|
|
29
41
|
end
|
data/lib/sentry/version.rb
CHANGED
data/lib/sentry-ruby.rb
CHANGED
|
@@ -220,6 +220,35 @@ module Sentry
|
|
|
220
220
|
get_current_scope.set_context(*args)
|
|
221
221
|
end
|
|
222
222
|
|
|
223
|
+
# @!method set_attributes
|
|
224
|
+
# Updates the current scope's attributes by merging with the old value.
|
|
225
|
+
# @param attributes_hash [Hash]
|
|
226
|
+
# @return [Hash]
|
|
227
|
+
def set_attributes(attributes_hash)
|
|
228
|
+
return unless initialized?
|
|
229
|
+
get_current_scope.set_attributes(attributes_hash)
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# @!method set_attribute
|
|
233
|
+
# Sets a single attribute on the current scope.
|
|
234
|
+
# @param key [String, Symbol]
|
|
235
|
+
# @param value [Object]
|
|
236
|
+
# @param unit [String, Symbol, nil] an optional measurement unit for the value
|
|
237
|
+
# @return [Hash]
|
|
238
|
+
def set_attribute(key, value, unit: nil)
|
|
239
|
+
return unless initialized?
|
|
240
|
+
get_current_scope.set_attribute(key, value, unit: unit)
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# @!method remove_attribute
|
|
244
|
+
# Removes a single attribute from the current scope.
|
|
245
|
+
# @param key [String, Symbol]
|
|
246
|
+
# @return [void]
|
|
247
|
+
def remove_attribute(key)
|
|
248
|
+
return unless initialized?
|
|
249
|
+
get_current_scope.remove_attribute(key)
|
|
250
|
+
end
|
|
251
|
+
|
|
223
252
|
# @!method add_attachment
|
|
224
253
|
# @!macro add_attachment
|
|
225
254
|
def add_attachment(**opts)
|
|
@@ -242,7 +271,8 @@ module Sentry
|
|
|
242
271
|
client = Client.new(config)
|
|
243
272
|
scope = Scope.new(max_breadcrumbs: config.max_breadcrumbs)
|
|
244
273
|
hub = Hub.new(client, scope)
|
|
245
|
-
|
|
274
|
+
@hub_isolation_level = config.hub_isolation_level
|
|
275
|
+
set_current_hub_internal(hub)
|
|
246
276
|
@main_hub = hub
|
|
247
277
|
@background_worker = Sentry::BackgroundWorker.new(config)
|
|
248
278
|
@session_flusher = config.session_tracking? ? Sentry::SessionFlusher.new(config, client) : nil
|
|
@@ -280,7 +310,7 @@ module Sentry
|
|
|
280
310
|
|
|
281
311
|
MUTEX.synchronize do
|
|
282
312
|
@main_hub = nil
|
|
283
|
-
|
|
313
|
+
set_current_hub_internal(nil)
|
|
284
314
|
end
|
|
285
315
|
end
|
|
286
316
|
|
|
@@ -333,7 +363,7 @@ module Sentry
|
|
|
333
363
|
# ideally, we should do this proactively whenever a new thread is created
|
|
334
364
|
# but it's impossible for the SDK to keep track every new thread
|
|
335
365
|
# so we need to use this rather passive way to make sure the app doesn't crash
|
|
336
|
-
|
|
366
|
+
get_current_hub_internal || clone_hub_to_current_thread
|
|
337
367
|
end
|
|
338
368
|
|
|
339
369
|
# Returns the current active client.
|
|
@@ -351,12 +381,14 @@ module Sentry
|
|
|
351
381
|
get_current_hub.current_scope
|
|
352
382
|
end
|
|
353
383
|
|
|
354
|
-
# Clones the main
|
|
384
|
+
# Clones the main hub and stores it for the current execution context
|
|
385
|
+
# (the current thread, or the current fiber when +config.hub_isolation_level+
|
|
386
|
+
# is +:fiber+).
|
|
355
387
|
#
|
|
356
388
|
# @return [void]
|
|
357
389
|
def clone_hub_to_current_thread
|
|
358
390
|
return unless initialized?
|
|
359
|
-
|
|
391
|
+
set_current_hub_internal(get_main_hub.clone)
|
|
360
392
|
end
|
|
361
393
|
|
|
362
394
|
# Takes a block and yields the current active scope.
|
|
@@ -708,6 +740,59 @@ module Sentry
|
|
|
708
740
|
def dependency_installed?(name)
|
|
709
741
|
Object.const_defined?(name)
|
|
710
742
|
end
|
|
743
|
+
|
|
744
|
+
# Reads the hub stored for the current execution context. The active
|
|
745
|
+
# isolation level (cached from +config.hub_isolation_level+ at init) decides
|
|
746
|
+
# whether that context is the current thread or the current fiber. Reads the
|
|
747
|
+
# cached level rather than the configuration to avoid recursing back through
|
|
748
|
+
# hub resolution.
|
|
749
|
+
#
|
|
750
|
+
# @!visibility private
|
|
751
|
+
# @return [Hub, nil]
|
|
752
|
+
def get_current_hub_internal
|
|
753
|
+
if @hub_isolation_level == :fiber
|
|
754
|
+
owner, hub = ::Fiber[THREAD_LOCAL]
|
|
755
|
+
|
|
756
|
+
# Child fibers, and threads started from them, inherit fiber storage
|
|
757
|
+
# holding the same Hub object rather than a copy.
|
|
758
|
+
if owner.equal?(::Fiber.current)
|
|
759
|
+
hub
|
|
760
|
+
elsif hub
|
|
761
|
+
set_current_hub_internal(fork_hub(hub))
|
|
762
|
+
end
|
|
763
|
+
else
|
|
764
|
+
::Thread.current.thread_variable_get(THREAD_LOCAL)
|
|
765
|
+
end
|
|
766
|
+
end
|
|
767
|
+
|
|
768
|
+
# Copies +hub+ for a context that inherited it. The span is re-attached
|
|
769
|
+
# because Scope#dup deep-copies it, and spans recorded on a detached
|
|
770
|
+
# transaction copy are never sent.
|
|
771
|
+
#
|
|
772
|
+
# @!visibility private
|
|
773
|
+
# @param hub [Hub]
|
|
774
|
+
# @return [Hub]
|
|
775
|
+
def fork_hub(hub)
|
|
776
|
+
span = hub.current_scope.span
|
|
777
|
+
forked = hub.clone
|
|
778
|
+
forked.current_scope.set_span(span) if span
|
|
779
|
+
|
|
780
|
+
forked
|
|
781
|
+
end
|
|
782
|
+
|
|
783
|
+
# Stores +hub+ for the current execution context (thread or fiber).
|
|
784
|
+
#
|
|
785
|
+
# @!visibility private
|
|
786
|
+
# @param hub [Hub, nil]
|
|
787
|
+
# @return [Hub, nil]
|
|
788
|
+
def set_current_hub_internal(hub)
|
|
789
|
+
if @hub_isolation_level == :fiber
|
|
790
|
+
::Fiber[THREAD_LOCAL] = [::Fiber.current, hub]
|
|
791
|
+
hub # callers use the return value, so don't return the pair
|
|
792
|
+
else
|
|
793
|
+
::Thread.current.thread_variable_set(THREAD_LOCAL, hub)
|
|
794
|
+
end
|
|
795
|
+
end
|
|
711
796
|
end
|
|
712
797
|
end
|
|
713
798
|
|
data/sentry-ruby-core.gemspec
CHANGED
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
|
14
14
|
spec.platform = Gem::Platform::RUBY
|
|
15
15
|
spec.required_ruby_version = '>= 2.7'
|
|
16
16
|
spec.extra_rdoc_files = ["README.md", "LICENSE.txt"]
|
|
17
|
-
spec.files = `git ls-files | grep -Ev '^(spec|benchmarks|examples|\.rubocop\.yml)'`.split("\n")
|
|
17
|
+
spec.files = `git ls-files | grep -Ev '^(spec|benchmarks|examples|test-matrix\.json|\.rubocop\.yml)'`.split("\n")
|
|
18
18
|
|
|
19
19
|
spec.metadata["homepage_uri"] = spec.homepage
|
|
20
20
|
spec.metadata["source_code_uri"] = spec.homepage
|
data/sentry-ruby.gemspec
CHANGED
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
|
13
13
|
spec.platform = Gem::Platform::RUBY
|
|
14
14
|
spec.required_ruby_version = '>= 2.7'
|
|
15
15
|
spec.extra_rdoc_files = ["README.md", "LICENSE.txt"]
|
|
16
|
-
spec.files = `git ls-files | grep -Ev '^(spec|benchmarks|examples|\.rubocop\.yml)'`.split("\n")
|
|
16
|
+
spec.files = `git ls-files | grep -Ev '^(spec|benchmarks|examples|test-matrix\.json|\.rubocop\.yml)'`.split("\n")
|
|
17
17
|
|
|
18
18
|
github_root_uri = 'https://github.com/getsentry/sentry-ruby'
|
|
19
19
|
spec.homepage = "#{github_root_uri}/tree/#{spec.version}/#{spec.name}"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sentry-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.
|
|
4
|
+
version: 6.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sentry Team
|
|
@@ -76,6 +76,36 @@ files:
|
|
|
76
76
|
- Rakefile
|
|
77
77
|
- bin/console
|
|
78
78
|
- bin/setup
|
|
79
|
+
- bin/test
|
|
80
|
+
- gemfiles/ruby-2.7_rack-2_redis-4.gemfile.lock
|
|
81
|
+
- gemfiles/ruby-2.7_rack-3.1_redis-4.gemfile.lock
|
|
82
|
+
- gemfiles/ruby-2.7_rack-3_redis-4.gemfile.lock
|
|
83
|
+
- gemfiles/ruby-3.0_rack-2_redis-4.gemfile.lock
|
|
84
|
+
- gemfiles/ruby-3.0_rack-3.1_redis-4.gemfile.lock
|
|
85
|
+
- gemfiles/ruby-3.0_rack-3_redis-4.gemfile.lock
|
|
86
|
+
- gemfiles/ruby-3.1_rack-2_redis-4.gemfile.lock
|
|
87
|
+
- gemfiles/ruby-3.1_rack-3.1_redis-4.gemfile.lock
|
|
88
|
+
- gemfiles/ruby-3.1_rack-3_redis-4.gemfile.lock
|
|
89
|
+
- gemfiles/ruby-3.2_rack-0_redis-5.gemfile.lock
|
|
90
|
+
- gemfiles/ruby-3.2_rack-2_redis-4.gemfile.lock
|
|
91
|
+
- gemfiles/ruby-3.2_rack-2_redis-5.gemfile.lock
|
|
92
|
+
- gemfiles/ruby-3.2_rack-3.1_redis-4.gemfile.lock
|
|
93
|
+
- gemfiles/ruby-3.2_rack-3_redis-4.gemfile.lock
|
|
94
|
+
- gemfiles/ruby-3.2_rack-3_redis-5.gemfile.lock
|
|
95
|
+
- gemfiles/ruby-3.3_rack-2_redis-4.gemfile.lock
|
|
96
|
+
- gemfiles/ruby-3.3_rack-3.1_redis-4.gemfile.lock
|
|
97
|
+
- gemfiles/ruby-3.3_rack-3.1_redis-5.3.gemfile.lock
|
|
98
|
+
- gemfiles/ruby-3.3_rack-3_redis-4.gemfile.lock
|
|
99
|
+
- gemfiles/ruby-3.4_rack-2_redis-4.gemfile.lock
|
|
100
|
+
- gemfiles/ruby-3.4_rack-3.1_redis-4.gemfile.lock
|
|
101
|
+
- gemfiles/ruby-3.4_rack-3.1_redis-5.3.gemfile.lock
|
|
102
|
+
- gemfiles/ruby-3.4_rack-3_redis-4.gemfile.lock
|
|
103
|
+
- gemfiles/ruby-4.0_rack-2_redis-4.gemfile.lock
|
|
104
|
+
- gemfiles/ruby-4.0_rack-3.1_redis-4.gemfile.lock
|
|
105
|
+
- gemfiles/ruby-4.0_rack-3_redis-4.gemfile.lock
|
|
106
|
+
- gemfiles/ruby-jruby-9.4.14.0_rack-2_redis-4.gemfile.lock
|
|
107
|
+
- gemfiles/ruby-jruby-9.4.14.0_rack-3.1_redis-4.gemfile.lock
|
|
108
|
+
- gemfiles/ruby-jruby-9.4.14.0_rack-3_redis-4.gemfile.lock
|
|
79
109
|
- lib/sentry-ruby.rb
|
|
80
110
|
- lib/sentry/attachment.rb
|
|
81
111
|
- lib/sentry/background_worker.rb
|
|
@@ -170,15 +200,15 @@ files:
|
|
|
170
200
|
- lib/sentry/version.rb
|
|
171
201
|
- sentry-ruby-core.gemspec
|
|
172
202
|
- sentry-ruby.gemspec
|
|
173
|
-
homepage: https://github.com/getsentry/sentry-ruby/tree/6.
|
|
203
|
+
homepage: https://github.com/getsentry/sentry-ruby/tree/6.7.0/sentry-ruby
|
|
174
204
|
licenses:
|
|
175
205
|
- MIT
|
|
176
206
|
metadata:
|
|
177
|
-
homepage_uri: https://github.com/getsentry/sentry-ruby/tree/6.
|
|
178
|
-
source_code_uri: https://github.com/getsentry/sentry-ruby/tree/6.
|
|
179
|
-
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/6.
|
|
207
|
+
homepage_uri: https://github.com/getsentry/sentry-ruby/tree/6.7.0/sentry-ruby
|
|
208
|
+
source_code_uri: https://github.com/getsentry/sentry-ruby/tree/6.7.0/sentry-ruby
|
|
209
|
+
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/6.7.0/CHANGELOG.md
|
|
180
210
|
bug_tracker_uri: https://github.com/getsentry/sentry-ruby/issues
|
|
181
|
-
documentation_uri: http://www.rubydoc.info/gems/sentry-ruby/6.
|
|
211
|
+
documentation_uri: http://www.rubydoc.info/gems/sentry-ruby/6.7.0
|
|
182
212
|
rdoc_options: []
|
|
183
213
|
require_paths:
|
|
184
214
|
- lib
|