sentry-ruby 5.28.1 → 6.0.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/Gemfile +1 -1
- data/lib/sentry/background_worker.rb +1 -4
- data/lib/sentry/breadcrumb.rb +1 -1
- data/lib/sentry/breadcrumb_buffer.rb +2 -2
- data/lib/sentry/check_in_event.rb +2 -2
- data/lib/sentry/client.rb +26 -87
- data/lib/sentry/configuration.rb +74 -75
- data/lib/sentry/cron/monitor_check_ins.rb +3 -3
- data/lib/sentry/cron/monitor_config.rb +2 -2
- data/lib/sentry/cron/monitor_schedule.rb +2 -2
- data/lib/sentry/envelope/item.rb +1 -2
- data/lib/sentry/error_event.rb +3 -3
- data/lib/sentry/event.rb +4 -10
- data/lib/sentry/hub.rb +3 -4
- data/lib/sentry/interface.rb +1 -1
- data/lib/sentry/interfaces/exception.rb +2 -2
- data/lib/sentry/interfaces/request.rb +2 -0
- data/lib/sentry/interfaces/single_exception.rb +3 -3
- data/lib/sentry/interfaces/stacktrace.rb +3 -3
- data/lib/sentry/interfaces/stacktrace_builder.rb +0 -8
- data/lib/sentry/interfaces/threads.rb +2 -2
- data/lib/sentry/log_event.rb +1 -1
- data/lib/sentry/profiler.rb +4 -5
- data/lib/sentry/rspec.rb +1 -1
- data/lib/sentry/span.rb +2 -17
- data/lib/sentry/test_helper.rb +1 -0
- data/lib/sentry/transaction.rb +52 -103
- data/lib/sentry/transaction_event.rb +4 -9
- data/lib/sentry/transport.rb +2 -5
- data/lib/sentry/utils/logging_helper.rb +8 -6
- data/lib/sentry/vernier/profiler.rb +4 -3
- data/lib/sentry/version.rb +1 -1
- data/lib/sentry-ruby.rb +2 -30
- data/sentry-ruby-core.gemspec +1 -1
- data/sentry-ruby.gemspec +1 -1
- metadata +7 -17
- data/lib/sentry/metrics/aggregator.rb +0 -248
- data/lib/sentry/metrics/configuration.rb +0 -57
- data/lib/sentry/metrics/counter_metric.rb +0 -25
- data/lib/sentry/metrics/distribution_metric.rb +0 -25
- data/lib/sentry/metrics/gauge_metric.rb +0 -35
- data/lib/sentry/metrics/local_aggregator.rb +0 -53
- data/lib/sentry/metrics/metric.rb +0 -19
- data/lib/sentry/metrics/set_metric.rb +0 -28
- data/lib/sentry/metrics/timing.rb +0 -51
- data/lib/sentry/metrics.rb +0 -68
data/lib/sentry/metrics.rb
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "sentry/metrics/metric"
|
4
|
-
require "sentry/metrics/counter_metric"
|
5
|
-
require "sentry/metrics/distribution_metric"
|
6
|
-
require "sentry/metrics/gauge_metric"
|
7
|
-
require "sentry/metrics/set_metric"
|
8
|
-
require "sentry/metrics/timing"
|
9
|
-
require "sentry/metrics/aggregator"
|
10
|
-
|
11
|
-
module Sentry
|
12
|
-
module Metrics
|
13
|
-
DURATION_UNITS = %w[nanosecond microsecond millisecond second minute hour day week]
|
14
|
-
INFORMATION_UNITS = %w[bit byte kilobyte kibibyte megabyte mebibyte gigabyte gibibyte terabyte tebibyte petabyte pebibyte exabyte exbibyte]
|
15
|
-
FRACTIONAL_UNITS = %w[ratio percent]
|
16
|
-
|
17
|
-
OP_NAME = "metric.timing"
|
18
|
-
SPAN_ORIGIN = "auto.metric.timing"
|
19
|
-
|
20
|
-
class << self
|
21
|
-
def increment(key, value = 1.0, unit: "none", tags: {}, timestamp: nil)
|
22
|
-
log_deprecation
|
23
|
-
Sentry.metrics_aggregator&.add(:c, key, value, unit: unit, tags: tags, timestamp: timestamp)
|
24
|
-
end
|
25
|
-
|
26
|
-
def distribution(key, value, unit: "none", tags: {}, timestamp: nil)
|
27
|
-
log_deprecation
|
28
|
-
Sentry.metrics_aggregator&.add(:d, key, value, unit: unit, tags: tags, timestamp: timestamp)
|
29
|
-
end
|
30
|
-
|
31
|
-
def set(key, value, unit: "none", tags: {}, timestamp: nil)
|
32
|
-
log_deprecation
|
33
|
-
Sentry.metrics_aggregator&.add(:s, key, value, unit: unit, tags: tags, timestamp: timestamp)
|
34
|
-
end
|
35
|
-
|
36
|
-
def gauge(key, value, unit: "none", tags: {}, timestamp: nil)
|
37
|
-
log_deprecation
|
38
|
-
Sentry.metrics_aggregator&.add(:g, key, value, unit: unit, tags: tags, timestamp: timestamp)
|
39
|
-
end
|
40
|
-
|
41
|
-
def timing(key, unit: "second", tags: {}, timestamp: nil, &block)
|
42
|
-
log_deprecation
|
43
|
-
|
44
|
-
return unless block_given?
|
45
|
-
return yield unless DURATION_UNITS.include?(unit)
|
46
|
-
|
47
|
-
result, value = Sentry.with_child_span(op: OP_NAME, description: key, origin: SPAN_ORIGIN) do |span|
|
48
|
-
tags.each { |k, v| span.set_tag(k, v.is_a?(Array) ? v.join(", ") : v.to_s) } if span
|
49
|
-
|
50
|
-
start = Timing.send(unit.to_sym)
|
51
|
-
result = yield
|
52
|
-
value = Timing.send(unit.to_sym) - start
|
53
|
-
|
54
|
-
[result, value]
|
55
|
-
end
|
56
|
-
|
57
|
-
Sentry.metrics_aggregator&.add(:d, key, value, unit: unit, tags: tags, timestamp: timestamp)
|
58
|
-
result
|
59
|
-
end
|
60
|
-
|
61
|
-
def log_deprecation
|
62
|
-
Sentry.sdk_logger.warn(LOGGER_PROGNAME) do
|
63
|
-
"`Sentry::Metrics` is now deprecated and will be removed in the next major."
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|