new TransactionHandle(transaction, metrics)
A light representation of a transaction instance, returned by calling API#getTransaction
.
Parameters:
Name | Type | Description |
---|---|---|
transaction | Transaction | the associated transaction |
metrics | Metrics | class instance |
- Source
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:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
transportType | string | <optional> | Unknown | The transport type that delivered the trace; defaults to 'Unknown'. |
headers | object | Headers to search for supported formats. Keys must be lowercase. |
- Source
end(callback)
End the transaction.
Parameters:
Name | Type | Description |
---|---|---|
callback | function | The function to call after ending the transaction. |
- Source
ignore()
Mark the transaction to be ignored.
- Source
insertDistributedTraceHeaders(headers)
Inserts distributed trace headers into the provided headers map.
Parameters:
Name | Type | Description |
---|---|---|
headers | object | DT headers |
- Source
isSampled()
Return whether this Transaction is being sampled
- Source