Created
July 2, 2014 21:29
-
-
Save pglombardo/e69b1f6c082bbfb37f93 to your computer and use it in GitHub Desktop.
Async Test Instrumentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EventMachine::HttpConnection.class_eval do | |
def setup_request_with_oboe(*args, &block) | |
c = nil | |
::Oboe::API.log_entry('em-http-request', { uri: @uri, start: 'start' }) | |
c = setup_request_without_oboe(*args, &block) | |
c.req.headers["X-Trace"] = Oboe::Context.toString() | |
::Oboe::API.log(nil, 'info', { uri: @uri }) | |
::Oboe::API.log_exit('em-http-request', { Async: true }) | |
c | |
end | |
alias :setup_request_without_oboe :setup_request | |
alias :setup_request :setup_request_with_oboe | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment