Class: NewRelic::Agent::Transaction

Inherits:
Object
  • Object
show all
Includes:
Tracing
Defined in:
lib/new_relic/agent/transaction.rb,
lib/new_relic/agent/transaction/external_request_segment.rb

Overview

This class represents a single transaction (usually mapping to one web request or background job invocation) instrumented by the Ruby agent.

Defined Under Namespace

Classes: ExternalRequestSegment

Class Method Summary collapse

Class Method Details

.recording_web_transaction?Boolean

Returns truthy if the current in-progress transaction is considered a a web transaction (as opposed to, e.g., a background transaction).

Returns:

  • (Boolean)

181
182
183
184
185
186
# File 'lib/new_relic/agent/transaction.rb', line 181

def self.recording_web_transaction? #THREAD_LOCAL_ACCESS
  NewRelic::Agent.record_api_supportability_metric(:recording_web_transaction?)

  txn = tl_current
  txn && txn.recording_web_transaction?
end