Class: ThriftRack::Sentry

Inherits:
Object
  • Object
show all
Defined in:
lib/thrift_rack/sentry.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Sentry

Returns a new instance of Sentry.



3
4
5
# File 'lib/thrift_rack/sentry.rb', line 3

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
# File 'lib/thrift_rack/sentry.rb', line 7

def call(env)
  req = Rack::Request.new(env)
  Raven.extra_context(request_id: req.env["HTTP_X_REQUEST_ID"], rpc_id: req.env["HTTP_X_RPC_ID"], from: req.env["HTTP_X_FROM"])
  @app.call(env)
end