Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sample_rate applying to non error events #2203

Merged
merged 2 commits into from Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/sentry_opentelemetry_test.yml
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
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
@@ -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
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