Method: NewRelic::Agent::DistributedTracing#create_distributed_trace_payload

Defined in:
lib/new_relic/agent/distributed_tracing.rb

#create_distributed_trace_payloadDistributedTracePayload

Create a payload object containing the current transaction's tracing properties (e.g., duration, priority). You can use this object to generate headers to inject into a network request, so that the downstream service can participate in a distributed trace.

Returns:


30
31
32
33
34
35
36
37
# File 'lib/new_relic/agent/distributed_tracing.rb', line 30

def create_distributed_trace_payload
  if transaction = Transaction.tl_current
    transaction.create_distributed_trace_payload
  end
rescue => e
  NewRelic::Agent.logger.error 'error during create_distributed_trace_payload', e
  nil
end