This class represents a single transaction (usually mapping to one web request or background job invocation) instrumented by the Ruby agent.
@api public
| 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 |
| 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. |
Returns truthy if the current in-progress transaction is considered a a web transaction (as opposed to, e.g., a background transaction).
@api public
Call this to ensure that the current transaction trace is not saved To fully ignore all metrics and errors, use ignore! instead.
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.