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.
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.