-
Notifications
You must be signed in to change notification settings - Fork 394
Description
Tracer Version(s)
2.12.2
Ruby Version(s)
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux-musl]
Relevent Library and Version(s)
pg (1.5.8)
Bug Report
Recently we upgraded our use of this gem from version 2.2.0
to 2.9.0
. Afterward, we began to see a large number of errors being emitted in the Rails console on our Kubernetes runner pods, making the console unusable. Upgrading to 2.12.2
has not fixed the issue. We've had to modify our initializer and would like to know if there is a better path, or a fix could be looked at.
Any advice would be welcome.
Reproduction Code
rails c
Configuration Block
To fix this, we had to wrap our entire Datadog.configure do
initializer with the following:
unless Rails.const_defined?(:Console) && !Rails.env.local?
Error Logs
Sample error, being repeated many times for every entry into the console prompt:
[2025-03-20T12:31:07.824170 #17] ERROR -- datadog: [datadog] (/usr/local/bundle/gems/datadog-2.12.2/lib/datadog/tracing/contrib/active_record/events/sql.rb:72:in 'rescue in on_start') You can't invoke instance_variable_get on #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter:0x00007f7c5f841€20>
Followed by
W, [2025-03-20T12:31:07.824661 #17] WARN -- datadog: [datadog] Sql comment propagation with 'full' mode is aborted, because tracing is disabled. Please set 'Datadog.configuration.tracing.enabled= true' to continue.
Operating System
x86_64-linux-musl
How does Datadog help you?
No response