ルール実行のトレースを容易にする
Automation for Jira バージョン 8.0.5 以降では、イベントによって引き起こされたルール実行を簡単に追跡できるように、DEBUG レベルでより多くの情報が記録されます。
セットアップ
トレース情報を利用できるようにするために DEBUG レベルで設定する必要があるログ カテゴリは 3 つだけです。
- com.codebarrel.jira.plugin.automation.event - このカテゴリは、A4J での Jira イベント処理に関連するログを提供します。
- com.codebarrel.jira.plugin.automation.queue - このカテゴリは、キューでサポートされている非同期ルール実行に関連するログを提供します。
- com.codebarrel.automation.api.service - このカテゴリは、すべてのルール実行に関連するログを提供します。
ログ レベルの設定の詳細については、このナレッジ ベース記事を参照してください。
以下に、A4J での Jira イベント処理とルール実行の仕組みを説明するために使用された自動化ルールの例を示します。
このルールは、課題作成イベントに反応して、新たに作成された課題の下に新しいコメントを追加するという単純なものです。
キャプチャされたログ
これは、SCRUM という名前のプロジェクトで課題が作成されたときにメインの Jira ログ ファイルからキャプチャされた出力です。キャプチャされたデータは、分析しやすいように 60 行だけにトリミングされました。関連するペイロードの中央にあった重要でない行もいくつか削除されました。また、システムには、課題の作成に反応してはならない自動化ルールが 3 つ追加されていました。ログには、それらがどのように無視されるかについての情報が含まれています。
次の表には 3 つの列が含まれていますので、重要なコメントを見るには水平方向にスクロールしてください。
| いいえ | コンテンツ | コメント |
|---|---|---|
| 1 | 2022-10-13 09:31:51,705+0200 Received Jira issue event bundle: | A4J 組み込みイベント リスナーに新しい課題関連イベントが通知されます。 |
| 2 | 2022-10-13 09:31:51,705+0200 Rule registry received issue event bundle: | キャプチャされたイベント |
| 3 | 2022-10-13 09:31:51,705+0200 Rule registry has extracted 1 event(s) from bundle. | ルール レジストリのイベント ハンドラーは、リスナーから受け取った |
| 4 | 2022-10-13 09:31:51,705+0200 Rule registry is handling issue event: | これは、処理中のイベントの詳細を示す情報です。 |
| 5 | 2022-10-13 09:31:51,711+0200 Received generic event : | A4J Jira イベント リスナーは他のスレッドでも動作しているため、 |
| 6 | 2022-10-13 09:31:51,711+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | 上記でキャプチャされた PerformanceEvent に関連する別のエントリです |
| 7 | 2022-10-13 09:31:51,722+0200 Rule registry executeEventRules init: | これは重要な情報です。 |
| 8 | 2022-10-13 09:31:51,722+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | この情報によると、トレースされているイベントへの反応として実行できる |
| 9 | 2022-10-13 09:31:51,732+0200 Submitting AutomationEvent 'jira:issue_created:issue_created' | Jira イベントは自動化イベントに変換され、 |
| 10 | 2022-10-13 09:31:51,736+0200 Started processing queue item: QueueItemBean{ | 自動化実行プログラム スレッド (「automation-rule-executor:thread-5」) |
| 11 | 2022-10-13 09:31:51,736+0200 Async executor is processing AutomationEvent | これは、同じ実行プログラム スレッド |
| 12 | 2022-10-13 09:31:51,737+0200 Async executor found 3 rules for AutomationEvent | 自動化実行プログラムは、使用可能なルールに対して |
| 13 | 2022-10-13 09:31:51,739+0200 Component can not handle: | 1 つ目のルールは「課題へのコメント追加」トリガーで開始され、 |
| 14 | 2022-10-13 09:31:51,740+0200 Async executor postponed execution of Rule(id=4, name='comment to audit log') | 自動化スレッドは上記のルールを無視しました。 |
| 15 | 2022-10-13 09:31:51,742+0200 Component can not handle: ComponentTypeKey{ | 2 つ目のルールは「フィールドの値変更」トリガーで開始され、 |
| 16 | 2022-10-13 09:31:51,742+0200 Async executor postponed execution | 自動化スレッドは上記のルールを無視しました。 |
| 17 | 2022-10-13 09:31:51,748+0200 Rule execution 'Global rule for Issue created' (rule ID [2], audit ID [7]) | 3 つ目のルールは自動化イベントに適合するため、このルールが実行されます。 |
| 18 | 2022-10-13 09:31:51,748+0200 Started executing component jira.issue.event.trigger:created. | 「Global rule for Issue created」の実行を開始します。 |
| 19 | 2022-10-13 09:31:51,759+0200 | トリガー コンポーネントを実行します。これは単なるパススルー実行です。 |
| 20 | 2022-10-13 09:31:51,759+0200 Started executing component jira.issue.comment. | 「課題へのコメント追加」アクションの実行を開始します。 |
| 21 | 2022-10-13 09:31:51,769+0200 Received generic event : | ここで、A4J イベント リスナーは、「Global rule for Issue created」 |
| 22 | 2022-10-13 09:31:51,769+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | 派生イベントを処理します (「automation-rule-executor:thread-5」で照合)。 |
| 23 | 2022-10-13 09:31:51,769+0200 Received generic event : | 派生イベントをキャプチャします (「automation-rule-executor:thread-5」で照合)。 |
| 24 | 2022-10-13 09:31:51,769+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | 派生イベントを処理します (「automation-rule-executor:thread-5」で照合)。 |
| 25 | 2022-10-13 09:31:51,769+0200 Received generic event : | 派生イベントをキャプチャします (「automation-rule-executor:thread-5」で照合)。 |
| 26 | 2022-10-13 09:31:51,770+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | 派生イベントを処理します (「automation-rule-executor:thread-5」で照合)。 |
| 27 | 2022-10-13 09:31:51,771+0200 Received generic event : | 派生イベントをキャプチャします (「automation-rule-executor:thread-5」で照合)。 |
| 28 | 2022-10-13 09:31:51,771+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | 派生イベントを処理します (「automation-rule-executor:thread-5」で照合)。 |
| 29 | 2022-10-13 09:31:51,771+0200 | 派生イベントをキャプチャします (「automation-rule-executor:thread-5」で照合)。 |
| 30 | 2022-10-13 09:31:51,771+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | 派生イベントを処理します (「automation-rule-executor:thread-5」で照合)。 |
| 31 | 2022-10-13 09:31:51,771+0200 Received generic event : | 派生イベントをキャプチャします (「automation-rule-executor:thread-5」で照合)。 |
| 32 | 2022-10-13 09:31:51,772+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | 派生イベントを処理します (「automation-rule-executor:thread-5」で照合)。 |
| 33 | 2022-10-13 09:31:51,772+0200 Received Jira issue event bundle: | 派生イベントをキャプチャします (「automation-rule-executor:thread-5」で照合)。 |
| 34 | 2022-10-13 09:31:51,772+0200 | 派生イベントを処理します (「automation-rule-executor:thread-5」で照合)。 |
| 35 | 2022-10-13 09:31:51,772+0200 | 処理中のイベント バンドルには 1 つの課題関連イベントが含まれています。 |
| 36 | 2022-10-13 09:31:51,772+0200 Rule registry is handling issue event: | このイベントは、課題 SCRUM-2 にコメントが追加されたことを示しています。 |
| 37 | 2022-10-13 09:31:51,772+0200 Rule registry executeEventRules init: | このイベントに対して入れ子トレース ID が生成されます。 |
| 38 | 2022-10-13 09:31:51,772+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | 入れ子イベントに対するサードパーティ製ルールはありません。 |
| 39 | 2022-10-13 09:31:51,778+0200 Received generic event : | その間、A4J Jira イベント リスナーは |
| 40 | 2022-10-13 09:31:51,778+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | 上記と同じコンテキストですが、ハンドラーがそのジョブを実行します。 |
| 41 | 2022-10-13 09:31:51,781+0200 Submitting AutomationEvent 'jira:issue_updated:issue_commented' | これは、キューに送信された入れ子イベントの |
| 42 | 2022-10-13 09:31:51,782+0200 Received generic event : | その間、A4J Jira イベント リスナーは |
| 43 | 2022-10-13 09:31:51,782+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | 上記と同じコンテキストですが、ハンドラーがそのジョブを実行します。 |
| 44 | 2022-10-13 09:31:51,785+0200 Started processing queue item: QueueItemBean{ | 自動化実行プログラム スレッド (「automation-rule-executor:thread-6」) |
| 45 | 2022-10-13 09:31:51,785+0200 Async executor is processing AutomationEvent | これは、課題にコメントが追加された後に発生した入れ子イベントを |
| 46 | 2022-10-13 09:31:51,786+0200 Async executor found 3 rules for AutomationEvent | 実行プログラムは、最終照合のためにルールを読み取って分析します。 |
| 47 | 2022-10-13 09:31:51,788+0200 Ignoring event 'EVENT:jira:issue_updated:issue_commented' | イベントが入れ子になっていることは A4J に認識されているため、実行は無視されます。 |
| 48 | 2022-10-13 09:31:51,788+0200 Async executor postponed execution of Rule(id=4, name='comment to audit log') | このルール トリガーは自動化イベント タイプには適合しません。 |
| 49 | 2022-10-13 09:31:51,792+0200 Component can not handle: ComponentTypeKey{ | このルール トリガーは自動化イベント タイプには適合しません。 |
| 50 | 2022-10-13 09:31:51,792+0200 Async executor postponed execution of | このルール トリガーは自動化イベント タイプには適合しません。 |
| 51 | 2022-10-13 09:31:51,793+0200 Component can not handle: ComponentTypeKey{ | このルール トリガーは自動化イベント タイプには適合しません。 |
| 52 | 2022-10-13 09:31:51,793+0200 Async executor postponed execution of | このルール トリガーは自動化イベント タイプには適合しません。 |
| 53 | 2022-10-13 09:31:51,794+0200 Resolving queue item (in 9ms): QueueItemBean{ | 自動化実行プログラム スレッドは、入れ子イベントに対するジョブを終了します。 |
| 54 | 2022-10-13 09:31:51,810+0200 Received Jira issue property set event : | これは、最初のイベント実行プログラムからの追加情報です。 |
| 55 | 2022-10-13 09:31:51,810+0200 Rule registry received issue property event: | 上記と同じですが、ハンドラーのジョブによるものです。 |
| 56 | 2022-10-13 09:31:51,810+0200 Rule registry executeEventRules init: | 上記と同じですが、ハンドラーのジョブによるものです。 |
| 57 | 2022-10-13 09:31:51,810+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | 上記と同じですが、ハンドラーのジョブによるものです。 |
| 58 | 2022-10-13 09:31:51,811+0200 Completed executing component jira.issue.comment. | 「課題へのコメント追加」アクションの実行を終了します。 |
| 59 | 2022-10-13 09:31:51,812+0200 Rule execution 'Global rule for Issue created' (rule ID [2], audit ID [7]) | ルール実行を終了します。 |
| 60 | 2022-10-13 09:31:51,820+0200 | 自動化実行プログラムは、最初の自動化イベントに対するジョブを終了しました。 |
自動化スレッド全体のイベント フロー
最終更新日 2022 年 11 月 22 日
Powered by Confluence and Scroll Viewport.

