title | type | shortDescription | tags | metaDescription | redirects | freshnessValidatedDate | |||||
---|---|---|---|---|---|---|---|---|---|---|---|
current_trace_id (Python agent API) |
apiDoc |
Returns the trace ID of the current transaction. |
|
New Relic Python API: Returns the trace ID of the current transaction, which is used by some other calls. |
|
never |
newrelic.agent.current_trace_id()
Returns the trace ID of the current transaction or None
if no transaction exists.
Use current_trace_id
to retrieve the trace ID of the current transaction.
Returns the trace ID of the current transaction. Returns None
if there is no active transaction.
import newrelic.agent
@newrelic.agent.background_task()
def main():
trace_id = newrelic.agent.current_trace_id()