Skip to content

Commit

Permalink
Fix sample_rate applying to non error events (#2203)
Browse files Browse the repository at this point in the history
  • Loading branch information
sl0thentr0py authored Dec 18, 2023
1 parent 4781aab commit 502547e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/sentry_opentelemetry_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
uses: ruby/setup-ruby@8ddb7b3348b3951590db24c346e94ebafdabc926
with:
ruby-version: ${{ matrix.ruby_version }}
bundler: "2.3"

- name: Run specs
env:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/sentry_rails_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ jobs:
with:
ruby-version: ${{ matrix.ruby_version }}
bundler: "2.3"
rubygems: ${{ matrix.rails_version == '7.1.0' && 'latest' || 'default' }}
# rails 7.1.0 requires latest rubygems
# but 3.5.0 dropped ruby 2.7 so we need to pin to something that works for all our shit
rubygems: ${{ matrix.rails_version == '7.1.0' && '3.4.22' || 'default' }}

- name: Build with Rails ${{ matrix.rails_version }}
env:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 5.15.2

### Bug Fixes

- Fix `sample_rate` applying to check-in events [#2203](https://github.com/getsentry/sentry-ruby/pull/2203)
- Fixes [#2202](https://github.com/getsentry/sentry-ruby/issues/2202)

## 5.15.1

### Features
Expand Down
2 changes: 1 addition & 1 deletion sentry-ruby/lib/sentry/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def initialize(configuration)
def capture_event(event, scope, hint = {})
return unless configuration.sending_allowed?

unless event.is_a?(TransactionEvent) || configuration.sample_allowed?
if event.is_a?(ErrorEvent) && !configuration.sample_allowed?
transport.record_lost_event(:sample_rate, 'event')
return
end
Expand Down

0 comments on commit 502547e

Please sign in to comment.