Skip to content

Commit dbccd78

Browse files
committed
Capture Cockroach DB config in sentry-rails ActiveRecordSubscriber
1 parent 168b43a commit dbccd78

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- Respect custom `Delayed::Job.max_attempts` if it's defined [#2176](https://github.com/getsentry/sentry-ruby/pull/2176)
2828
- Fixed a bug where `Net::HTTP` instrumentation won't work for some IPv6 addresses [#2180](https://github.com/getsentry/sentry-ruby/pull/2180)
2929
- Allow non-string error message to be reported to sentry ([#2137](https://github.com/getsentry/sentry-ruby/pull/2137))
30+
- `sentry-rails` will now capture Cockroach DB adapter config into spans data [#2182](https://github.com/getsentry/sentry-ruby/pull/2182)
3031

3132
## 5.13.0
3233

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

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ def self.subscribe!
3131
connection.pool.db_config.configuration_hash
3232
elsif connection.pool.respond_to?(:spec)
3333
connection.pool.spec.config
34+
# CockroachDB pool shows up as NullPool, but we can grab
35+
# it's configuration from the instance variable.
36+
elsif connection.instance_variable_defined?(:@config)
37+
connection.instance_variable_get(:@config)
3438
end
3539

3640
next unless db_config

0 commit comments

Comments
 (0)