TransactionHandle

new TransactionHandle(transaction, metrics)

A light representation of a transaction instance, returned by calling API#getTransaction.

Parameters:
NameTypeDescription
transactionTransaction

the associated transaction

metricsMetrics

class instance

Methods

acceptDistributedTraceHeaders(transportTypeopt, headers)

Parsing incoming headers for use in a distributed trace. W3C TraceContext format is preferred over the NewRelic DT format. NewRelic DT format will be used if no traceparent header is found.

Parameters:
NameTypeAttributesDefaultDescription
transportTypestring<optional>
Unknown

The transport type that delivered the trace; defaults to 'Unknown'.

headersobject

Headers to search for supported formats. Keys must be lowercase.

end(callback)

End the transaction.

Parameters:
NameTypeDescription
callbackfunction

The function to call after ending the transaction.

ignore()

Mark the transaction to be ignored.

insertDistributedTraceHeaders(headers)

Inserts distributed trace headers into the provided headers map.

Parameters:
NameTypeDescription
headersobject

DT headers

isSampled()

Return whether this Transaction is being sampled