module OneApm::Transaction::TransactionFinishAppend

Public Instance Methods

append_apdex_perf_zone(duration, payload) click to toggle source
# File lib/one_apm/transaction/transaction_finish_append.rb, line 29
def append_apdex_perf_zone(duration, payload)
  return unless recording_web_transaction?

  bucket = apdex_bucket(duration)
  bucket_str = case bucket
  when :apdex_s then Transaction::OA_APDEX_S
  when :apdex_t then Transaction::OA_APDEX_T
  when :apdex_f then Transaction::OA_APDEX_F
  else nil
  end
  payload[:apdex_perf_zone] = bucket_str if bucket_str
end
append_cat_info(state, duration, payload) click to toggle source
# File lib/one_apm/transaction/transaction_finish_append.rb, line 7
def append_cat_info(state, duration, payload)
  return unless include_guid?(state, duration)
  payload[:guid] = guid

  return unless state.is_cross_app?
  trip_id             = cat_trip_id(state)
  path_hash           = cat_path_hash(state)
  referring_path_hash = cat_referring_path_hash(state)

  payload[:cat_trip_id]             = trip_id             if trip_id
  payload[:cat_referring_path_hash] = referring_path_hash if referring_path_hash

  if path_hash
    payload[:cat_path_hash] = path_hash

    alternate_path_hashes = cat_path_hashes - [path_hash]
    unless alternate_path_hashes.empty?
      payload[:cat_alternate_path_hashes] = alternate_path_hashes
    end
  end
end
append_http_response_code(payload) click to toggle source
# File lib/one_apm/transaction/transaction_finish_append.rb, line 49
def append_http_response_code(payload)
  payload[:http_response_code] = http_response_code if http_response_code
end
append_metric_ids_to(payload) click to toggle source
# File lib/one_apm/transaction/transaction_finish_append.rb, line 61
def append_metric_ids_to(payload)
  payload[:metric_ids] = agent.service.metric_id_cache if agent.service
end
append_referring_transaction_guid_to(state, payload) click to toggle source
# File lib/one_apm/transaction/transaction_finish_append.rb, line 42
def append_referring_transaction_guid_to(state, payload)
  referring_guid = OneApm::Manager.agent.cross_app_monitor.client_referring_transaction_guid(state)
  if referring_guid
    payload[:referring_transaction_guid] = referring_guid
  end
end
append_synthetics_to(state, payload) click to toggle source
# File lib/one_apm/transaction/transaction_finish_append.rb, line 53
def append_synthetics_to(state, payload)
  return unless is_synthetics_request?

  payload[:synthetics_resource_id] = synthetics_resource_id
  payload[:synthetics_job_id]      = synthetics_job_id
  payload[:synthetics_monitor_id]  = synthetics_monitor_id
end
include_guid?(state, duration) click to toggle source
# File lib/one_apm/transaction/transaction_finish_append.rb, line 65
def include_guid?(state, duration)
  state.is_cross_app? || is_synthetics_request?
end