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

Metaprogramming fixes when using a new client #229

Closed wvanbergen closed 4 years ago

wvanbergen commented 4 years ago

For the metaprogrammign methods (statsd_count, statsd_measure, etc.), we still would like to support deprecated arguments like prefix and as_dist. However, when setting StatsD.singleton_client to a new client without enabling strict mode, we end up doing metric calls with arguments that are no longer supported.

This PR fixes that by handling the deprecated logic in the metaprogramming method directly, rather than forwarding the deprecated arguments to the metric methods.