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を照会して、最近のテストで生成されたトレース(処理経路の記録)を探す。
このスキルは次のような場合に自動的に起動します:
照会結果を次の形式で報告します: [VIZ]を照会しました(フィルタ: [FILTERS]、グループ化: [GROUP_BY]、期間: [TIME_RANGE]) 結果: [Honeycombの照会へのリンク]
テスト対象のサービスは何ですか? これにより照会するデータセット(データの集まり)が決まります。 期待される「スパン」(処理の単位)の名前は分かっていますか?
照会内容:
- データセット: [dataset]
- フィルタ: name = [期待されるスパン名]
- 時間範囲: [計算済みの期間]
- 計算方法: COUNT
- サンプルを含める: true
最新のサンプルを取得し、get_traceを使って完全なトレースを取得します。 報告形式:
[計算方法]を照会しました(フィルタ: [FILTERS]、期間: [TIME_RANGE]) [count]件の結果が見つかりました 結果: [照会へのリンク]
最新のトレース: [トレースへのリンク] ルートスパン: [ルートスパン名] 総スパン数: [スパンの数] サービス: [サービスの一覧]
照会内容:
- すべてのデータセット
- フィルタ: trace.parent_id does-not-exist
- 時間範囲: [計算済みの期間]
- 計算方法: COUNT
- 分類: name
- サンプルを含める: true
報告形式: [計算方法]を照会しました(フィルタ: [FILTERS]、分類: [BREAKDOWNS]、期間: [TIME_RANGE]) [count]件の結果が見つかりました 結果: [照会へのリンク]
各サンプルについて以下を表示します:
Honeycombのトレースリンクを以下の形式で構築します:
https://ui.honeycomb.io/modernity/environments/personal-agent/trace?trace_id=[<traceId>]
&trace_start_ts=[test_start_time]
&trace_end_ts=[((date +%s))]
照会内容:
計算フィールド: event_time=EVENT_TIMESTAMP()
計算方法: COUNT
分類: event_time, trace.trace_id
並び順: event_time DESC
上限: 1
サンプルを含める: false
パターン1の形式でトレースの概要を表示します。
取得したtrace_idを使ってget_traceで完全なトレースを取得します。
トレースを生成するテストを実行する前に、現在時刻を表示します。
start_time=$(date +%s)
次にテストを実行してトレースを生成します。
次に、正確な時間範囲を計算します:
echo $(( $(date +%s) - $start_time + 20))
その値を使用してトレースを検索します。
Query Honeycomb to find the traces that were created by a recent test.
This skill is automatically activated when:
Report query results as: Queried [VIZ] where [FILTERS] by [GROUP_BY] over [TIME_RANGE] Results: [link to Honeycomb query]
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]
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:
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.
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 による自動翻訳です。