Method: NewRelic::Agent::Transaction::ExternalRequestSegment#process_response_metadata

Defined in:
lib/new_relic/agent/transaction/external_request_segment.rb

#process_response_metadata(response_metadata) ⇒ Object

Process obfuscated String sent from a called application that is also running a New Relic agent and save information in current transaction for inclusion in a trace. This String is generated by get_response_metadata on the receiving application.

Parameters:

  • response_metadata (String)

    received obfuscated response metadata


157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/new_relic/agent/transaction/external_request_segment.rb', line 157

def  
  NewRelic::Agent.record_api_supportability_metric(:process_response_metadata)
  if transaction
    app_data = ::JSON.parse(obfuscator.deobfuscate())[APP_DATA_KEY]

    # validate cross app id
    #
    if Array === app_data and CrossAppTracing.trusted_valid_cross_app_id? app_data[0]
      @app_data = app_data
      update_segment_name
    else
      NewRelic::Agent.logger.error "error processing response metadata: invalid/non-trusted ID"
    end
  end

  nil
rescue => e
  NewRelic::Agent.logger.error "error during process_response_metadata", e
end