Method: NewRelic::Agent::Tracer.in_transaction
- Defined in:
- lib/new_relic/agent/tracer.rb
.in_transaction(name: nil, partial_name: nil, category:, options: {}) ⇒ Object
Runs the given block of code in a transaction.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/new_relic/agent/tracer.rb', line 90 def in_transaction(name: nil, partial_name: nil, category:, options: {}) finishable = start_transaction_or_segment( name: name, partial_name: partial_name, category: category, options: ) begin # We shouldn't raise from Tracer.start_transaction_or_segment, but # only wrap the yield to be absolutely sure we don't report agent # problems as app errors yield rescue => exception current_transaction.notice_error(exception) raise ensure finishable&.finish end end |