Commit 3b5cde4 1 parent a8094be commit 3b5cde4 Copy full SHA for 3b5cde4
File tree 7 files changed +28
-6
lines changed
7 files changed +28
-6
lines changed Original file line number Diff line number Diff line change 5
5
- Fix handling of cron with tz in Cron::Job ([ #2530 ] ( https://github.com/getsentry/sentry-ruby/pull/2530 ) )
6
6
- Revert "[ rails] support string errors in error reporter (#2464 )" ([ #2533 ] ( https://github.com/getsentry/sentry-ruby/pull/2533 ) )
7
7
8
+ ### Miscellaneous
9
+
10
+ - Deprecate ` enable_tracing ` in favor of ` traces_sample_rate = 1.0 ` [ #2535 ] ( https://github.com/getsentry/sentry-ruby/pull/2535 )
11
+
8
12
## 5.22.3
9
13
10
14
### Bug Fixes
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def copy_initializer_file
16
16
Sentry.init do |config|
17
17
config.breadcrumbs_logger = [:active_support_logger]
18
18
config.dsn = #{ dsn }
19
- config.enable_tracing = true
19
+ config.traces_sample_rate = 1.0
20
20
end
21
21
RUBY
22
22
end
Original file line number Diff line number Diff line change 55
55
Sentry.init do |config|
56
56
config.breadcrumbs_logger = [:active_support_logger]
57
57
config.dsn = ENV['SENTRY_DSN']
58
- config.enable_tracing = true
58
+ config.traces_sample_rate = 1.0
59
59
end
60
60
RUBY
61
61
end
87
87
Sentry.init do |config|
88
88
config.breadcrumbs_logger = [:active_support_logger]
89
89
config.dsn = 'foobarbaz'
90
- config.enable_tracing = true
90
+ config.traces_sample_rate = 1.0
91
91
end
92
92
RUBY
93
93
end
Original file line number Diff line number Diff line change @@ -264,6 +264,7 @@ def capture_exception_frame_locals=(value)
264
264
265
265
# Easier way to use performance tracing
266
266
# If set to true, will set traces_sample_rate to 1.0
267
+ # @deprecated It will be removed in the next major release.
267
268
# @return [Boolean, nil]
268
269
attr_reader :enable_tracing
269
270
@@ -485,6 +486,12 @@ def instrumenter=(instrumenter)
485
486
end
486
487
487
488
def enable_tracing = ( enable_tracing )
489
+ unless enable_tracing . nil?
490
+ log_warn <<~MSG
491
+ `enable_tracing` is now deprecated in favor of `traces_sample_rate = 1.0`.
492
+ MSG
493
+ end
494
+
488
495
@enable_tracing = enable_tracing
489
496
@traces_sample_rate ||= 1.0 if enable_tracing
490
497
end
Original file line number Diff line number Diff line change 122
122
123
123
expect ( subject . tracing_enabled? ) . to eq ( false )
124
124
end
125
+
126
+ it "prints deprecation message when being assigned" do
127
+ string_io = StringIO . new
128
+ subject . logger = Logger . new ( string_io )
129
+
130
+ subject . enable_tracing = true
131
+
132
+ expect ( string_io . string ) . to include (
133
+ "WARN -- sentry: `enable_tracing` is now deprecated in favor of `traces_sample_rate = 1.0`."
134
+ )
135
+ end
125
136
end
126
137
end
127
138
Original file line number Diff line number Diff line change 11
11
before do
12
12
perform_basic_setup do |config |
13
13
config . metrics . enabled = true
14
- config . enable_tracing = true
14
+ config . traces_sample_rate = 1.0
15
15
config . release = 'test-release'
16
16
config . environment = 'test'
17
17
config . logger = Logger . new ( string_io )
194
194
before do
195
195
perform_basic_setup do |config |
196
196
config . metrics . enabled = true
197
- config . enable_tracing = true
197
+ config . traces_sample_rate = 1.0
198
198
config . release = 'test-release'
199
199
config . environment = 'test'
200
200
config . logger = Logger . new ( string_io )
Original file line number Diff line number Diff line change 116
116
117
117
before do
118
118
perform_basic_setup do |config |
119
- config . enable_tracing = true
119
+ config . traces_sample_rate = 1.0
120
120
config . metrics . enabled = true
121
121
end
122
122
You can’t perform that action at this time.
0 commit comments