{"action":"created","issue":{"url":"https://api.github.com/repos/Shopify/statsd-instrument/issues/91","repository_url":"https://api.github.com/repos/Shopify/statsd-instrument","labels_url":"https://api.github.com/repos/Shopify/statsd-instrument/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/Shopify/statsd-instrument/issues/91/comments","events_url":"https://api.github.com/repos/Shopify/statsd-instrument/issues/91/events","html_url":"https://github.com/Shopify/statsd-instrument/issues/91","id":171184889,"number":91,"title":"Calling `statsd_measure` after prepending a module causes infinite loop","user":{"login":"sgrif","id":1529387,"avatar_url":"https://avatars.githubusercontent.com/u/1529387?v=3","gravatar_id":"","url":"https://api.github.com/users/sgrif","html_url":"https://github.com/sgrif","followers_url":"https://api.github.com/users/sgrif/followers","following_url":"https://api.github.com/users/sgrif/following{/other_user}","gists_url":"https://api.github.com/users/sgrif/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrif/subscriptions","organizations_url":"https://api.github.com/users/sgrif/orgs","repos_url":"https://api.github.com/users/sgrif/repos","events_url":"https://api.github.com/users/sgrif/events{/privacy}","received_events_url":"https://api.github.com/users/sgrif/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-15T14:45:34Z","updated_at":"2016-08-15T15:38:16Z","closed_at":null,"body":"To reproduce:\r\n\r\n```ruby\r\nrequire \"bundler/inline\"\r\n\r\ngemfile(true) do\r\n  gem \"statsd-instrument\", github: \"shopify/statsd-instrument\"\r\nend\r\n\r\nclass Foo\r\n  def foo\r\n    puts \"foo\"\r\n  end\r\nend\r\n\r\nmodule MyPatch\r\n  def foo\r\n    puts \"before foo\"\r\n    super\r\n  end\r\nend\r\n\r\nFoo.prepend(MyPatch)\r\n\r\nFoo.extend(StatsD::Instrument)\r\nFoo.statsd_measure :foo, \"Foo!\"\r\n\r\nFoo.new.foo\r\n```\r\n\r\nOutput:\r\n\r\n```\r\nbefore foo\r\nbefore foo\r\nbefore foo\r\nbefore foo\r\nbefore foo\r\nbefore foo\r\nbefore foo\r\nbefore foo\r\nbefore foo\r\n/Users/sean/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/statsd-instrument-154487eb6a1d/lib/statsd/instrument.rb:75:in `block (3 levels) in statsd_measure': stack level too deep (SystemStackError)\r\n\tfrom /Users/sean/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/statsd-instrument-154487eb6a1d/lib/statsd/instrument.rb:284:in `block in measure'\r\n\tfrom /Users/sean/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/statsd-instrument-154487eb6a1d/lib/statsd/instrument.rb:53:in `duration'\r\n\tfrom /Users/sean/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/statsd-instrument-154487eb6a1d/lib/statsd/instrument.rb:284:in `measure'\r\n\tfrom /Users/sean/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/statsd-instrument-154487eb6a1d/lib/statsd/instrument.rb:75:in `block (2 levels) in statsd_measure'\r\n\tfrom foo.rb:16:in `foo'\r\n\tfrom /Users/sean/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/statsd-instrument-154487eb6a1d/lib/statsd/instrument.rb:75:in `block (3 levels) in statsd_measure'\r\n\tfrom /Users/sean/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/statsd-instrument-154487eb6a1d/lib/statsd/instrument.rb:284:in `block in measure'\r\n\tfrom /Users/sean/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/statsd-instrument-154487eb6a1d/lib/statsd/instrument.rb:53:in `duration'\r\n\t ... 10758 levels...\r\n\tfrom /Users/sean/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/statsd-instrument-154487eb6a1d/lib/statsd/instrument.rb:284:in `measure'\r\n\tfrom /Users/sean/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/statsd-instrument-154487eb6a1d/lib/statsd/instrument.rb:75:in `block (2 levels) in statsd_measure'\r\n\tfrom foo.rb:16:in `foo'\r\n\tfrom foo.rb:25:in `<main>'\r\n```\r\n\r\nThis would likely be solved by changing `statsd_measure` to use `Module.prepend`, which this gem can now do as it doesn't support 1.9.3"},"comment":{"url":"https://api.github.com/repos/Shopify/statsd-instrument/issues/comments/239835713","html_url":"https://github.com/Shopify/statsd-instrument/issues/91#issuecomment-239835713","issue_url":"https://api.github.com/repos/Shopify/statsd-instrument/issues/91","id":239835713,"user":{"login":"sgrif","id":1529387,"avatar_url":"https://avatars.githubusercontent.com/u/1529387?v=3","gravatar_id":"","url":"https://api.github.com/users/sgrif","html_url":"https://github.com/sgrif","followers_url":"https://api.github.com/users/sgrif/followers","following_url":"https://api.github.com/users/sgrif/following{/other_user}","gists_url":"https://api.github.com/users/sgrif/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrif/subscriptions","organizations_url":"https://api.github.com/users/sgrif/orgs","repos_url":"https://api.github.com/users/sgrif/repos","events_url":"https://api.github.com/users/sgrif/events{/privacy}","received_events_url":"https://api.github.com/users/sgrif/received_events","type":"User","site_admin":false},"created_at":"2016-08-15T15:38:16Z","updated_at":"2016-08-15T15:38:16Z","body":"Yeah I'm about to submit a PR"}}
{"actor":{"display_login":"sgrif"}}