You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reloading...
ArgumentError: Already instrumented consume_and_grant for
from /Users/<user>/.gem/ruby/2.7.5/gems/statsd-instrument-3.1.2/lib/statsd/instrument.rb:263:in `add_to_method'
Possible cause
StatsD::Instrument having a cache that is likely not being reset on reload
Workaround
You can instrument inside the file that has the module being instrumented:
Environment
Ruby interpreter version: ruby 2.7.5
statsd-instrument version: 3.1.2
StatsD backend: Datadog
Rails: 7.0.2.3
Machine: Mac M1
OS: Mac OS Monterey 12.3.1
Description
Anything that triggers reloading will throw error from statsd-instrument when instrumenting class methods from config/initializer.
How to reproduce
Given this code in Rails:
Reload fails in console:
bin/rails console
reload!
Observe this error:
Possible cause
StatsD::Instrument having a cache that is likely not being reset on reload
Workaround
You can instrument inside the file that has the module being instrumented:
The text was updated successfully, but these errors were encountered: