Method: NewRelic::Agent::DistributedTracePayload#text

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

#textString

Represent this payload as a raw JSON string.

Returns:

  • (String)

    Payload translated to JSON

[View source]

125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb', line 125

def text
  result = {
    VERSION_KEY => version
  }

  result[DATA_KEY] = {
    PARENT_TYPE_KEY => parent_type,
    PARENT_ACCOUNT_ID_KEY => ,
    PARENT_APP_KEY => parent_app_id,
    TX_KEY => transaction_id,
    TRACE_ID_KEY => trace_id,
    SAMPLED_KEY => sampled,
    PRIORITY_KEY => priority,
    TIMESTAMP_KEY => timestamp
  }

  result[DATA_KEY][ID_KEY] = id if id
  result[DATA_KEY][TRUSTED_ACCOUNT_KEY] =  if 

  JSON.dump(result)
end