Skip to content

Instantly share code, notes, and snippets.

@pglombardo
Created July 2, 2014 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pglombardo/e69b1f6c082bbfb37f93 to your computer and use it in GitHub Desktop.
Save pglombardo/e69b1f6c082bbfb37f93 to your computer and use it in GitHub Desktop.
Async Test Instrumentation
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