Skip to content

Commit 502547e

Browse files
authored
Fix sample_rate applying to non error events (#2203)
1 parent 4781aab commit 502547e

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

.github/workflows/sentry_opentelemetry_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
uses: ruby/setup-ruby@8ddb7b3348b3951590db24c346e94ebafdabc926
3535
with:
3636
ruby-version: ${{ matrix.ruby_version }}
37+
bundler: "2.3"
3738

3839
- name: Run specs
3940
env:

.github/workflows/sentry_rails_test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ jobs:
7373
with:
7474
ruby-version: ${{ matrix.ruby_version }}
7575
bundler: "2.3"
76-
rubygems: ${{ matrix.rails_version == '7.1.0' && 'latest' || 'default' }}
76+
# rails 7.1.0 requires latest rubygems
77+
# but 3.5.0 dropped ruby 2.7 so we need to pin to something that works for all our shit
78+
rubygems: ${{ matrix.rails_version == '7.1.0' && '3.4.22' || 'default' }}
7779

7880
- name: Build with Rails ${{ matrix.rails_version }}
7981
env:

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 5.15.2
2+
3+
### Bug Fixes
4+
5+
- Fix `sample_rate` applying to check-in events [#2203](https://github.com/getsentry/sentry-ruby/pull/2203)
6+
- Fixes [#2202](https://github.com/getsentry/sentry-ruby/issues/2202)
7+
18
## 5.15.1
29

310
### Features

sentry-ruby/lib/sentry/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def initialize(configuration)
4848
def capture_event(event, scope, hint = {})
4949
return unless configuration.sending_allowed?
5050

51-
unless event.is_a?(TransactionEvent) || configuration.sample_allowed?
51+
if event.is_a?(ErrorEvent) && !configuration.sample_allowed?
5252
transport.record_lost_event(:sample_rate, 'event')
5353
return
5454
end

0 commit comments

Comments
 (0)