Skip to content

Instantly share code, notes, and snippets.

@fbjork
Created November 5, 2010 22:23
Show Gist options
  • Save fbjork/664971 to your computer and use it in GitHub Desktop.
Save fbjork/664971 to your computer and use it in GitHub Desktop.
if defined? EventMachine::HttpRequest
EventMachine::HttpRequest.class_eval do
def setup_request_with_newrelic_trace(*args, &block)
metrics = ["External/#{@uri.host}/EventMachine::HttpRequest/#{args[0]}","External/#{@uri.host}/all"]
if NewRelic::Agent::Instrumentation::MetricFrame.recording_web_transaction?
metrics << "External/allWeb"
else
metrics << "External/allOther"
end
self.class.trace_execution_scoped metrics do
setup_request_without_newrelic_trace(*args, &block)
end
end
alias setup_request_without_newrelic_trace setup_request
alias setup_request setup_request_with_newrelic_trace
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment