Shopify / statsd-instrument

A StatsD client for Ruby apps. Provides metaprogramming methods to inject StatsD instrumentation into your code.
http://shopify.github.io/statsd-instrument
MIT License
570 stars 94 forks source link

Respect global StatsD.prefix changes when using metaprogramming methods. #202

Closed wvanbergen closed 4 years ago

wvanbergen commented 4 years ago

For the metaprogramming methods, we currently evaluate StatsD.prefix when the code is loading. If the prefix changes afterwards (for instance, in a Railtie or initializer), that new prefix will not be respected. This PR ensures that the new prefix will be respected.

I've also added some tests that demonstrate that you can override or clear the prefix when using the metaprogramming methods. When you do that, any changes to the global prefix will not have any affect on those metrics.

wvanbergen commented 4 years ago

Released as 2.5.1