-
Notifications
You must be signed in to change notification settings - Fork 374
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
Change in behavior in 2.0 for the Rails activerecord integration #4179
Comments
Hey @marcotc wanted to bump this one! |
Hey @alexevanczuk, I'm not sure I fully understand: what span exactly are you trying to set up an |
Hey @marcotc there are spans on the |
Hey @marcotc wanted to bump this. If it helps, here's the diff of the diff --git a/Gemfile.lock b/Gemfile.lock
index dfc055f0b8..51ba37fbb4 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -226,16 +226,13 @@ GEM
- datadog-ci (0.8.3)
+ datadog (2.7.0)
+ datadog-ruby_core_source (~> 3.3)
+ libdatadog (~> 14.1.0.1.0)
+ libddwaf (~> 1.15.0.0.0)
msgpack
+ datadog-ruby_core_source (3.3.6)
date (3.4.0)
- ddtrace (1.23.3)
- datadog-ci (~> 0.8.1)
- debase-ruby_core_source (= 3.3.1)
- libdatadog (~> 7.0.0.1.0)
- libddwaf (~> 1.14.0.0.0)
- msgpack
- debase-ruby_core_source (3.3.1)
- libdatadog (7.0.0.1.0)
- libdatadog (7.0.0.1.0-x86_64-linux)
- libddwaf (1.14.0.0.0-arm64-darwin)
+ libdatadog (14.1.0.1.0)
+ libdatadog (14.1.0.1.0-x86_64-linux)
+ libddwaf (1.15.0.0.0-arm64-darwin)
ffi (~> 1.0)
- libddwaf (1.14.0.0.0-x86_64-darwin)
+ libddwaf (1.15.0.0.0-x86_64-darwin)
ffi (~> 1.0)
- libddwaf (1.14.0.0.0-x86_64-linux)
+ libddwaf (1.15.0.0.0-x86_64-linux)
ffi (~> 1.0)
- ddtrace
+ datadog I turned on Before
After
Notice that with the same configuration it's now attaching an error to the span. Can you help me figure out where this behavior is? I tried messing with it for a while, but was having a lot of trouble tracing through the DD code and determining why the error was being set now. |
Okay, it looks like we're not passing span options to the active support notification and always setting the span error here:
I'm still unclear why there was no error before but now there is one though. |
@TonyCTHsu Wondering if you might be able to help with this! This results in really confusing error messages – such as related to incorrect queries in a rails console – that I'd like to turn off immediately and go back to the previous behavior in 1.x. |
The rails instrumentation sets up an activerecord integration here: https://github.com/DataDog/dd-trace-rb/blob/master/lib/datadog/tracing/contrib/rails/framework.rb
This sets up a service called
postgres
via the activerecord configuration (lib/datadog/tracing/contrib/active_record/configuration/settings.rb) which callsUtils.adapter_name
which callsContrib::Utils::Database.normalize_vendor(connection_config[:adapter])
which evaluates topostgres
.In our
postgres
service, we're now seeing new errors come in after the 2.0 upgrade. We typically turn off error propagation for our instrumentations because it results in double signal. That is – if an error propagates up and causes an application bug, it results in a bug in an outer span beyond the instrumentation. Normally we just set theon_error
(orerror_handler
prior to the 2.0 upgrade) as a no-op to not attach these errors to these instrumentation spans. However, we didn't need this for therails
instrumentation before, and now after 2.0 there doesn't appear to be a configuration option inlib/datadog/tracing/contrib/rails/configuration/settings.rb
that allows us to no-op these postgres errors.Please let me know your recommendation for disabling these errors again! Thank you!
The text was updated successfully, but these errors were encountered: