Skip to content

Commit 0b29c8e

Browse files
committed
Capture Cockroach DB config in sentry-rails ActiveRecordSubscriber
1 parent 4c8110c commit 0b29c8e

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
@@ -35,6 +35,7 @@
3535
- Respect custom `Delayed::Job.max_attempts` if it's defined [#2176](https://github.com/getsentry/sentry-ruby/pull/2176)
3636
- Fixed a bug where `Net::HTTP` instrumentation won't work for some IPv6 addresses [#2180](https://github.com/getsentry/sentry-ruby/pull/2180)
3737
- Allow non-string error message to be reported to sentry ([#2137](https://github.com/getsentry/sentry-ruby/pull/2137))
38+
- `sentry-rails` will now capture Cockroach DB adapter config into spans data [#2182](https://github.com/getsentry/sentry-ruby/pull/2182)
3839

3940
## 5.13.0
4041

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)