-
Notifications
You must be signed in to change notification settings - Fork 375
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
Ruby 3.2.0 gauge error for the RubyVM.stat API changes #2534
Comments
Thank you @marcotc! Sorry I haven't noticed that 3.2 is not supported yet 😅. Right now I've come up with this monkey patch to workaround it: Datadog::Core::Environment::VMCache.class_eval do
module_function
# Ruby >= 3.2 uses :constant_cache_invalidations instead of :global_constant_state
# This is a temporary workaround, the correct solution is to report both :constant_cache_invalidations and :constant_cache_misses in DD
# See https://github.com/ruby/ruby/pull/5433,
# https://github.com/DataDog/dd-trace-rb/blob/v1.5.0/lib/datadog/core/environment/vm_cache.rb#L23-L25
def global_constant_state
RubyVM.stat[:constant_cache_invalidations]
end
end Unfortunately, I've already shipped a Ruby 3.2 upgrade in one of our apps (with this patch). I haven't noticed any other major breakage so far but I'm afraid there are some subtle unnoticed errors, so right now I'm afraid to push forward a Ruby 3.2 upgrade on our main app, which has a lot of traffic. Do you have any ETA of when the Ruby 3.2 support will be available? |
+1 thank you for the support! |
@intrip Thank you for posting such a comprehensive issue report along with a temporary patch and linked references! This was a huge help to me today. Thank you! |
Thanks @intrip for the workaround and everyone for the patience. We're working on a fix for this and expect it to be included on the next dd-trace-rb release. |
@ivoanjo thank you so much for tackling this issue this week! And thank you for the updates. I want to set a reminder to check for an update so I can remove my patch in my code. What's your best guess as to a possible timeline for the 1.10 release? |
We aim to get a new release out every 4-8 weeks, which would put 1.10 towards the end of February/sometime in March. But, do let us know If this (or any other) issue is blocking or being really annoying for you, that helps us prioritize an earlier release. |
Current behavior
The gem started logging the following error in our app after we upgraded to Ruby 3.2.0:
Expected behaviour
The error shouldn't occur.
Steps to reproduce
Use any version of the
ddtrace
library (even the latest) onRuby 3.2.0
. When a metric flush occurs the above error is logged.How does
ddtrace
help you?The library should handle correctly the new Ruby 3.2.0 RubyVM.stat changes and rely on the new key
:constant_cache_invalidations
instead of:global_constant_state
forRuby >= 3.2.0
. It might also gauge the newly added key:constant_cache_misses
when available.See ruby/ruby#5433, https://github.com/DataDog/dd-trace-rb/blob/v1.5.0/lib/datadog/core/environment/vm_cache.rb#L23-L25, newrelic/newrelic-ruby-agent#1436
Environment
1.5.0
and1.8.0
but looks like all the versions are affectedDatadog.configure ...
):The text was updated successfully, but these errors were encountered: