Module: TraceView::Grape::Endpoint
- Defined in:
- lib/traceview/frameworks/grape.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(klass) ⇒ Object
19 20 21 |
# File 'lib/traceview/frameworks/grape.rb', line 19 def self.included(klass) ::TraceView::Util.method_alias(klass, :run, ::Grape::Endpoint) end |
Instance Method Details
#run_with_traceview(*args) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/traceview/frameworks/grape.rb', line 23 def run_with_traceview(*args) if TraceView.tracing? report_kvs = {} report_kvs[:Controller] = self.class if args.empty? report_kvs[:Action] = env['PATH_INFO'] else report_kvs[:Action] = args[0]['PATH_INFO'] end # Fall back to the raw tracing API so we can pass KVs # back on exit (a limitation of the TraceView::API.trace # block method) This removes the need for an info # event to send additonal KVs ::TraceView::API.log_entry('grape', {}) begin run_without_traceview(*args) ensure ::TraceView::API.log_exit('grape', report_kvs) end else run_without_traceview(*args) end end |