Class NewRelic::Agent::Transaction
In: lib/new_relic/agent/transaction/abstract_segment.rb
lib/new_relic/agent/transaction/external_request_segment.rb
lib/new_relic/agent/transaction/segment.rb
lib/new_relic/agent/transaction/request_attributes.rb
lib/new_relic/agent/transaction/transaction_sample_buffer.rb
lib/new_relic/agent/transaction/trace_node.rb
lib/new_relic/agent/transaction/synthetics_sample_buffer.rb
lib/new_relic/agent/transaction/slowest_sample_buffer.rb
lib/new_relic/agent/transaction/developer_mode_sample_buffer.rb
lib/new_relic/agent/transaction/tracing.rb
lib/new_relic/agent/transaction/xray_sample_buffer.rb
lib/new_relic/agent/transaction/attributes.rb
lib/new_relic/agent/transaction/trace.rb
lib/new_relic/agent/transaction/datastore_segment.rb
lib/new_relic/agent/transaction.rb
Parent: Object

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

@api public

Methods

abort_transaction!   abort_transaction!   add_agent_attribute   add_agent_attribute   add_custom_attributes   add_custom_parameters   apdex_bucket   apdex_bucket   apdex_t   append_apdex_perf_zone   append_cat_info   append_referring_transaction_guid_to   append_synthetics_to   assign_agent_attributes   assign_intrinsics   background_summary_metrics   best_name   calculate_gc_time   cat_path_hash   cat_referring_path_hash   cat_trip_id   commit!   cpu_burn   create_nested_frame   default_name=   freeze_name_and_execute_if_not_ignored   generate_payload   had_error_affecting_apdex?   ignore!   ignore?   ignore_apdex!   ignore_apdex?   ignore_enduser!   ignore_enduser?   ignore_trace?   include_guid?   influences_transaction_name?   instrumentation_state   is_synthetics_request?   jruby_cpu_burn   log_frozen_name   make_transaction_name   merge_metrics   merge_request_parameters   merge_untrusted_agent_attributes   merge_untrusted_agent_attributes   name_frozen?   name_last_frame   name_set?   needs_middleware_summary_metrics?   nested_transaction_name   new   normal_cpu_burn   notice_error   overridden_name=   promoted_transaction_name   queue_time   record_apdex   record_apdex_metrics   record_cat_path_hash   record_exceptions   record_queue_time   record_summary_metrics   record_transaction_event   recording_web_transaction?   recording_web_transaction?   referer   request_path   request_port   send_transaction_finished_event   set_default_transaction_name   set_default_transaction_name   set_overriding_transaction_name   set_overriding_transaction_name   set_user_attributes   similar_category?   start   start   start_new_transaction   stop   stop   summary_metrics   synthetics_account_id   synthetics_job_id   synthetics_monitor_id   synthetics_resource_id   synthetics_version   tl_current   transaction_specific_apdex_t   user_defined_rules_ignore?   web_category?   with_database_metric_name   wrap  

Included Modules

Tracing

Classes and Modules

Module NewRelic::Agent::Transaction::Tracing
Class NewRelic::Agent::Transaction::AbstractSegment
Class NewRelic::Agent::Transaction::Attributes
Class NewRelic::Agent::Transaction::DatastoreSegment
Class NewRelic::Agent::Transaction::DeveloperModeSampleBuffer
Class NewRelic::Agent::Transaction::ExternalRequestSegment
Class NewRelic::Agent::Transaction::RequestAttributes
Class NewRelic::Agent::Transaction::Segment
Class NewRelic::Agent::Transaction::SlowestSampleBuffer
Class NewRelic::Agent::Transaction::SyntheticsSampleBuffer
Class NewRelic::Agent::Transaction::Trace
Class NewRelic::Agent::Transaction::TraceNode
Class NewRelic::Agent::Transaction::TransactionSampleBuffer
Class NewRelic::Agent::Transaction::XraySampleBuffer

Constants

SUBTRANSACTION_PREFIX = 'Nested/'.freeze   for nested transactions
CONTROLLER_PREFIX = 'Controller/'.freeze
MIDDLEWARE_PREFIX = 'Middleware/Rack/'.freeze
TASK_PREFIX = 'OtherTransaction/Background/'.freeze
RAKE_PREFIX = 'OtherTransaction/Rake/'.freeze
RACK_PREFIX = 'Controller/Rack/'.freeze
SINATRA_PREFIX = 'Controller/Sinatra/'.freeze
GRAPE_PREFIX = 'Controller/Grape/'.freeze
ACTION_CABLE_PREFIX = 'Controller/ActionCable/'.freeze
OTHER_TRANSACTION_PREFIX = 'OtherTransaction/'.freeze
CONTROLLER_MIDDLEWARE_PREFIX = 'Controller/Middleware/Rack'.freeze
NESTED_TRACE_STOP_OPTIONS = { :metric => true }.freeze
WEB_TRANSACTION_CATEGORIES = [:controller, :uri, :rack, :sinatra, :grape, :middleware, :action_cable].freeze
TRANSACTION_NAMING_SOURCES = [:child, :api].freeze
MIDDLEWARE_SUMMARY_METRICS = ['Middleware/all'.freeze].freeze
EMPTY_SUMMARY_METRICS = [].freeze
TRACE_OPTIONS_SCOPED = { :metric => true, :scoped_metric => true }.freeze
TRACE_OPTIONS_UNSCOPED = { :metric => true, :scoped_metric => false }.freeze
FAILED_TO_STOP_MESSAGE = "Failed during Transaction.stop because there is no current transaction"
WEB_SUMMARY_METRIC = 'HttpDispatcher'.freeze
OTHER_SUMMARY_METRIC = 'OtherTransaction/all'.freeze
APDEX_S = 'S'.freeze
APDEX_T = 'T'.freeze
APDEX_F = 'F'.freeze
QUEUE_TIME_METRIC = 'WebFrontend/QueueTime'.freeze
APDEX_ALL_METRIC = 'ApdexAll'.freeze
APDEX_METRIC = 'Apdex'.freeze
APDEX_OTHER_METRIC = 'ApdexOther'.freeze
APDEX_TXN_METRIC_PREFIX = 'Apdex/'.freeze
APDEX_OTHER_TXN_METRIC_PREFIX = 'ApdexOther/Transaction/'.freeze
JRUBY_CPU_TIME_ERROR = "Error calculating JRuby CPU Time".freeze
HEX_DIGITS = (0..15).map{|i| i.to_s(16)}
GUID_LENGTH = 16

Attributes

apdex_start  [RW]  A Time instance used for calculating the apdex score, which might end up being @start, or it might be further upstream if we can find a request header for the queue entry time
attributes  [R] 
cat_path_hashes  [R] 
category  [R] 
exceptions  [RW] 
filtered_params  [RW] 
frame_stack  [R] 
gc_start_snapshot  [R] 
guid  [R] 
http_response_code  [RW] 
jruby_cpu_start  [RW] 
metrics  [R] 
payload  [R] 
process_cpu_start  [RW] 
raw_synthetics_header  [RW]  Fields for tracking synthetics requests
response_content_length  [RW] 
response_content_type  [RW] 
start_time  [RW]  A Time instance for the start time, never nil
state  [RW]  reference to the transaction state managing this transaction
synthetics_payload  [RW]  Fields for tracking synthetics requests
transaction_trace  [R]  Populated with the trace sample once this transaction is completed.

Public Class methods

Indicate that you don‘t want to keep the currently saved transaction information

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

@api public

Return the currently active transaction, or nil.

Public Instance methods

Call this to ensure that the current transaction trace is not saved To fully ignore all metrics and errors, use ignore! instead.

add_custom_parameters(p)

This transaction-local hash may be used as temprory storage by instrumentation that needs to pass data from one instrumentation point to another.

For example, if both A and B are instrumented, and A calls B but some piece of state needed by the instrumentation at B is only available at A, the instrumentation at A may write into the hash, call through, and then remove the key afterwards, allowing the instrumentation at B to read the value in between.

Keys should be symbols, and care should be taken to not generate key names dynamically, and to ensure that keys are removed upon return from the method that creates them.

The summary metrics recorded by this method all end up with a duration equal to the transaction itself, and an exclusive time of zero.

This event is fired when the transaction is fully completed. The metric values and sampler can‘t be successfully modified from this event.

set_user_attributes(p)

[Validate]