Class: Sleuth::OutboundHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/sleuth/outbound_handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ OutboundHeader

Returns a new instance of OutboundHeader.


3
4
5
# File 'lib/sleuth/outbound_handler.rb', line 3

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object


7
8
9
10
11
12
13
# File 'lib/sleuth/outbound_handler.rb', line 7

def call(env)
  request = Rack::Request.new(env)
  Sleuth.instrument("Sending #{request.request_method} #{request.url}") do
    env["HTTP_#{TRANSACTION_HEADER}"] = Sleuth.current_transaction.full_name
    @app.call(env)
  end
end