Skip to content

Instantly share code, notes, and snippets.

@mattjbray
Created October 17, 2013 15:26
Show Gist options
  • Save mattjbray/7026924 to your computer and use it in GitHub Desktop.
Save mattjbray/7026924 to your computer and use it in GitHub Desktop.
New Relic, Ruby, XMLRPC
::NewRelic::Agent.logger.info "Patching NetHTTPRequest for XMLRPC (in config/intializers/new_relic.rb)"
module NewRelic
module Agent
module HTTPClients
class NetHTTPRequest
def method
match = @request.body.match /<methodName>(.*)<\/methodName>/
if match
return match.captures.first
else
return @request.method
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment