Skip to content

Commit

Permalink
Fix db_config being nil in ActiveRecordSubscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
sl0thentr0py committed Sep 19, 2023
1 parent c916057 commit 4c3ed71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

- Rename `http.method` to `http.request.method` in `Span::DataConventions` [#2106](https://github.com/getsentry/sentry-ruby/pull/2106)
- Increase `Envelope::Item::MAX_SERIALIZED_PAYLOAD_SIZE` to 1MB [#2108](https://github.com/getsentry/sentry-ruby/pull/2108)
- Fix `db_config` begin `nil` in `ActiveRecordSubscriber` [#2111](https://github.com/getsentry/sentry-ruby/pull/2111)
- Fixes [#2109](https://github.com/getsentry/sentry-ruby/issues/2109)

## 5.11.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def self.subscribe!
connection.pool.spec.config
end

next unless db_config

Check warning on line 36 in sentry-rails/lib/sentry/rails/tracing/active_record_subscriber.rb

View check run for this annotation

Codecov / codecov/patch

sentry-rails/lib/sentry/rails/tracing/active_record_subscriber.rb#L36

Added line #L36 was not covered by tests

span.set_data(Span::DataConventions::DB_SYSTEM, db_config[:adapter]) if db_config[:adapter]
span.set_data(Span::DataConventions::DB_NAME, db_config[:database]) if db_config[:database]
span.set_data(Span::DataConventions::SERVER_ADDRESS, db_config[:host]) if db_config[:host]
Expand Down

0 comments on commit 4c3ed71

Please sign in to comment.