{"action":"created","issue":{"url":"https://api.github.com/repos/newrelic/rpm/issues/227","repository_url":"https://api.github.com/repos/newrelic/rpm","labels_url":"https://api.github.com/repos/newrelic/rpm/issues/227/labels{/name}","comments_url":"https://api.github.com/repos/newrelic/rpm/issues/227/comments","events_url":"https://api.github.com/repos/newrelic/rpm/issues/227/events","html_url":"https://github.com/newrelic/rpm/pull/227","id":127687162,"number":227,"title":"Replace alias_method with Module.prepend","user":{"login":"pschambacher","id":547203,"avatar_url":"https://avatars.githubusercontent.com/u/547203?v=3","gravatar_id":"","url":"https://api.github.com/users/pschambacher","html_url":"https://github.com/pschambacher","followers_url":"https://api.github.com/users/pschambacher/followers","following_url":"https://api.github.com/users/pschambacher/following{/other_user}","gists_url":"https://api.github.com/users/pschambacher/gists{/gist_id}","starred_url":"https://api.github.com/users/pschambacher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pschambacher/subscriptions","organizations_url":"https://api.github.com/users/pschambacher/orgs","repos_url":"https://api.github.com/users/pschambacher/repos","events_url":"https://api.github.com/users/pschambacher/events{/privacy}","received_events_url":"https://api.github.com/users/pschambacher/received_events","type":"User","site_admin":false},"labels":[{"id":325385546,"url":"https://api.github.com/repos/newrelic/rpm/labels/on%20hold","name":"on hold","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-01-20T13:53:47Z","updated_at":"2016-12-19T20:01:08Z","closed_at":"2016-12-19T20:01:08Z","pull_request":{"url":"https://api.github.com/repos/newrelic/rpm/pulls/227","html_url":"https://github.com/newrelic/rpm/pull/227","diff_url":"https://github.com/newrelic/rpm/pull/227.diff","patch_url":"https://github.com/newrelic/rpm/pull/227.patch"},"body":"This is work in progress but before moving further I'd like to be sure this PR would be accepted.\nWe're facing an issue at the moment since we replaced `alias_method_chain` with `Module.prepend` in some of ours gems (active_record_shards for instance). Mixing `alias_method_chain` and `Module.prepend` tend to provoke `stack level too deep` errors.\n\nThis PR aims to remove `alias_method` (used in the alias_method_chain way) in favor of `Module.prepend`.\n\nTo achieve this goal, Ruby < 2.0 need to be abandoned. IMHO this is fine since 1.8 and 1.9 aren't supported anymore.\n\nIf people are OK with this PR I'll keep going and remove all the other `alias_method` calls.\n@jasonrclark, @benweint ?\n\nEasier to review [without whitespaces](https://github.com/newrelic/rpm/pull/227/files?w=0)\n"},"comment":{"url":"https://api.github.com/repos/newrelic/rpm/issues/comments/268063185","html_url":"https://github.com/newrelic/rpm/pull/227#issuecomment-268063185","issue_url":"https://api.github.com/repos/newrelic/rpm/issues/227","id":268063185,"user":{"login":"kwugirl","id":3782112,"avatar_url":"https://avatars.githubusercontent.com/u/3782112?v=3","gravatar_id":"","url":"https://api.github.com/users/kwugirl","html_url":"https://github.com/kwugirl","followers_url":"https://api.github.com/users/kwugirl/followers","following_url":"https://api.github.com/users/kwugirl/following{/other_user}","gists_url":"https://api.github.com/users/kwugirl/gists{/gist_id}","starred_url":"https://api.github.com/users/kwugirl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwugirl/subscriptions","organizations_url":"https://api.github.com/users/kwugirl/orgs","repos_url":"https://api.github.com/users/kwugirl/repos","events_url":"https://api.github.com/users/kwugirl/events{/privacy}","received_events_url":"https://api.github.com/users/kwugirl/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T20:01:08Z","updated_at":"2016-12-19T20:01:08Z","body":"Hi everyone--wanted to share that last week we released a version of the agent that uses `Module#prepend` for ActiveRecord 5 instrumentation! See the release notes for [v3.17.2](https://docs.newrelic.com/docs/release-notes/agent-release-notes/ruby-release-notes/ruby-agent-3172327). This should help some of the folks that were seeing the `stack level too deep` errors in Rails 5 apps, since we think most of those were from the AR5 instrumentation.\r\n\r\nAdditionally, we published a blog post on this topic: [Resolving `Module#prepend` and `alias_method` Conflicts Involving the New Relic Ruby Agent](https://blog.newrelic.com/2016/12/15/ruby-agent-module-prepend-alias-method-chains/). It's largely intended as an introduction to why those errors come up, but also covers some of our current thinking. We would like to be able to install instrumentation using either `Module#prepend` _or_ `alias_method`, so we're closing this pull request in favor of that strategy instead. Thanks again however for bringing the issue up!"}}
{"actor":{"display_login":"kwugirl"}}