Syntax
newrelic.agent.current_transaction(active_only=True)
Returns an object corresponding to the current transaction.
Description
Use current_transaction
to retrieve the object representing the current transaction. It will return None
if there is no active transaction.
Parameters
Parameter | Description |
---|---|
boolean | Optional. Default is |
Return values
Returns a transaction object corresponding to current transaction. Returns None
if there is no active transaction.
Examples
Get the current transaction
import newrelic.agent
@newrelic.agent.background_task()def main(): transaction = newrelic.agent.current_transaction()
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicの とandドキュメント をご確認ください。