Method: OneApm::Agent::CrossAppTracingMessage.inject_rpc_request_headers

Defined in:
lib/one_apm/agent/cross_app/cross_app_tracing_message.rb

.inject_rpc_request_headers(state, rpc_request) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/one_apm/agent/cross_app/cross_app_tracing_message.rb', line 34

def inject_rpc_request_headers state, rpc_request
  txn_guid = state.request_guid
  txn = state.current_transaction
  if txn
    trip_id   = txn.cat_trip_id(state)
    path_hash = txn.cat_path_hash(state)
    if txn.raw_synthetics_header
      rpc_request[OA_SYNTHETICS_MESSAGE_HEADER] = txn.raw_synthetics_header
    end
  end
  rpc_request[OA_ID_MESSAGE_HEADER]  = cross_app_id
  rpc_request[OA_TXN_MESSAGE_HEADER] = [txn_guid, true, trip_id, path_hash, '']
rescue OneApm::Agent::CrossAppTracingMessage::Error => err #TODO
  OneApm::Manager.logger.debug "Not injecting x-process header", err
end