🔍verify-recent-trace
- プラグイン
- honeycomb
- ソース
- GitHub で見る ↗
説明
Honeycomb(オブザーバビリティプラットフォーム:システムの動作状況を可視化するツール)から最近のトレース(実行記録)を探して、最近のテスト実行時に何が起きたのかを確認します。 次のような場合に使用:「Honeycombで確認してほしい」「最新のトレースを見つけてほしい」「トレースを表示してほしい」と依頼された場合
原文を表示
Find a recent trace in Honeycomb, to see what happened in a recent test. Use when asked to "verify in Honeycomb", "find the most recent trace", or "show me the trace".
ユースケース
- ✓Honeycombで確認を依頼されたとき
- ✓最新のトレースを探すとき
- ✓テスト実行時の動作を確認するとき
- ✓トレースを表示することを依頼されたとき
本文(日本語訳)
Honeycomb 検証スキル
目的
Honeycomb(可視化・監視ツール)を照会して、最近のテストによって作成されたトレース(処理の流れ)を検索します。
使用する場合
このスキルは、以下のような場合に自動で起動します:
- ユーザーが「Honeycomb にトレースを表示してほしい」と依頼した
- 可視化検証(処理の見える化)が必要な実装ステップを完了した
検証結果の報告方法
クエリ(検索)の結果は以下の形式で報告します:
[VIZ] を照会しました。条件: [FILTERS]、集計方法: [GROUP_BY]、期間: [TIME_RANGE]
結果: [Honeycomb クエリへのリンク]
クエリパターン
- 時間範囲: 1200秒(20分)- テスト開始時刻に応じて調整可能
パターン1: 特定のトレースを取得する
テスト対象のサービスはどれですか?(これがデータセットを決めます) 予想されるスパン(処理単位)の名前を知っていますか?
以下の条件で照会:
- データセット: [dataset]
- 条件: name = [予想されるスパン名]
- 時間範囲: [計算済みの期間]
- 計算方法: COUNT(数える)
- サンプルを含める: true
最新のサンプルを取り、get_trace を使って完全なトレースを取得します。
結果:
[計算方法] を照会しました。条件: [FILTERS]、期間: [TIME_RANGE]
[count] 件の結果が見つかりました
結果: [クエリへのリンク]
最新のトレース: [トレースへのリンク]
ルートスパン(最上位の処理): [スパン名]
全スパン数: [数値]
関連サービス: [サービス一覧]
パターン2: テスト開始以降のすべてのトレースを検索する
以下の条件で照会:
- すべてのデータセット
- 条件: trace.parent_id does-not-exist(親トレースが存在しない)
- 時間範囲: [計算済みの期間]
- 計算方法: COUNT
- 集計: name(スパン名ごと)
- サンプルを含める: true
結果:
[計算方法] を照会しました。条件: [FILTERS]、集計: [BREAKDOWNS]、期間: [TIME_RANGE]
[count] 件の結果が見つかりました
結果: [クエリへのリンク]
各サンプルについて、以下を表示します:
- トレース ID
- スパン名
- その他の情報
Honeycomb 内のトレースへのリンクを以下の形式で作成します:
https://ui.honeycomb.io/modernity/environments/personal-agent/trace?trace_id=[<traceId>]
&trace_start_ts=[test_start_time]
&trace_end_ts=[((date +%s))]
パターン3: 最新のトレースを正確に検索する
以下の条件で照会:
計算項目: event_time=EVENT_TIMESTAMP()
計算方法: COUNT
集計: event_time、trace.trace_id
並び順: event_time(新しい順)
取得件数: 1
サンプルを含める: false
パターン1 と同じ形式でトレースの概要を表示します。
取得した trace_id を使い、get_trace で完全なトレースを取得します。
パターン4: トレースが見つからない場合: 時間範囲を調整する
トレースを生成するテストを実行する前に、現在時刻を記録します:
start_time=$(date +%s)
テストを実行してトレースを生成します。
その後、正しい時間範囲を計算します:
echo $(( $(date +%s) - $start_time + 20))
この値をトレース検索のクエリに含めます。
原文(English)を表示
Honeycomb Verification Skill
Purpose
Query Honeycomb to find the traces that were created by a recent test.
When to Use
This skill is automatically activated when:
- User asks to "show me a trace in Honeycomb"
- Completing an implementation step that requires observability verification
Verification Output
Report query results as: Queried [VIZ] where [FILTERS] by [GROUP_BY] over [TIME_RANGE] Results: [link to Honeycomb query]
Query Patterns
- Time Range: 1200 seconds (20 minutes) - adjustable based on when the test started
Pattern 1: Get a particular trace
What service are you testing? This determines the dataset. Do you know the name of the span you expect to see?
Query for:
- dataset: [dataset]
- filter: name = [expected span name]
- time_range: [calculated time range]
- calculation: COUNT
- include_samples: true
Now take the most recent sample, and use get_trace to get the full trace. Output:
Queried [CALCULATION] where [FILTERS] over [TIME_RANGE] Found [count] results Results: [link to the query]
Most recent trace: [link to the trace] Root span: [root span name] Total spans: [count of spans] Services: [list of services]
Pattern 2: Find all traces since the test started
Query for:
- all datasets
- filter: trace.parent_id does-not-exist
- time_range: [calculated time range]
- calculation: COUNT
- breakdowns: name
- include_samples: true
Output: Queried [CALCULATION] where [FILTERS] by [BREAKDOWNS] over [TIME_RANGE] Found [count] results Results: [link to the query]
For each sample, print:
- Trace ID
- Span name
- anything else it gives you Construct a link to the trace in Honeycomb, according to: https://ui.honeycomb.io/modernity/environments/personal-agent/trace?trace_id=[<traceId>] &trace_start_ts=[test_start_time] &trace_end_ts=[((date +%s))]
Pattern 3: Find the most recent trace, precisely
Query for:
calculated_fields: event_time=EVENT_TIMESTAMP()
calculation: COUNT
breakdowns: event_time, trace.trace_id
order: event_time DESC
limit: 1
include_samples: false
Print the summary of the trace, as in Pattern 1.
Take the output trace_id and use get_trace to get the full trace.
Pattern 4: When you don't see any traces, try: Get the time range right
Before running a test that will generate a trace, print the current time.
start_time=$(date +%s)
Then run the test to create the trace.
Then calculate the correct time range:
echo $(( $(date +%s) - $start_time + 20))
Include that in the query you're using to find traces.
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。