observability
できること
このスキルは、エージェントの実行に組み込まれた監視機能を説明します。トレース、評価、利用者のフィードバックを記録します。データはアプリ自身のデータベースに残ります。エージェントがどう動き、なぜそう動いたのかを確認したい開発者向けです。
使う場面
- ✓エージェントの実行中に何が起きたかを、手順ごとに確認したいとき。
- ✓エージェントの回答に対するフィードバックを集めたいとき。
- ✓エージェントの評価や A/B 実験を設定する必要があるとき。
スキルのリンク
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/observability/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“直近のいくつかのチャットで、エージェントがどのツールを呼び、各手順にどれくらい時間がかかったか見せてもらえますか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントの実行はすべて、手順、モデルの呼び出し、ツールの呼び出しとともに自動で記録されます。内容は既定で隠され、データはアプリ自身のデータベースに保存されます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Agent Observability
Rule
The observability system auto-instruments every agent run with zero configuration. Traces, automated evals, and feedback collection work out of the box. All data lives in the app's own SQL database — no external services required. Templates can optionally export to Langfuse, Datadog, or any OTel-compatible platform.
Five Pillars
1. Traces
Every runAgentLoop() call is automatically instrumented via instrumentAgentLoop() in packages/core/src/observability/traces.ts. It captures:
- agent_run span — top-level parent with total duration and cost
- llm_call span — model name, token counts (input, output, cache read/write), cost
- tool_call spans — one per action invocation, with duration and success/error
The run span is NAMED by what started it, because the trace list shows that name
and nothing else: a scheduled job is background_automation_run:<job name>, a
chat turn is agent_run, and a turn a feature sent on the user's behalf is
agent_run:<usageLabel> when the caller named it:
sendToAgentChat({
message: "Enrich this record from the web",
newTab: true,
usageLabel: "crm:enrich-record", // → usage row label + `agent_run:crm:enrich-record`
});
Content (prompts, tool args, tool results) is redacted by default. Opt in through the declared observability config domain:
// server/plugins/config.ts
import { defineAppConfig } from "@agent-native/core/server";
export default defineAppConfig({
observability: {
enabled: true,
capturePrompts: false,
captureToolArgs: true, // capture action input args
captureToolResults: false, // include results and full error text in local tool spans
evalSampleRate: 0.05, // 5% of runs get LLM-as-judge eval
inferredSentimentEnabled: false,
inferredSentimentSampleRate: 0,
inferredSentimentModel: "gpt-6-luna",
},
});
Two things are recorded whatever the flags say, because a failure nobody can classify is not observable:
- A failed tool span always keeps a signature: the first line of the error,
redacted (credentials, emails, long opaque ids) and capped at 500
characters.
captureToolResultsonly decides whether the rest is kept. The span's metadata says which (__tool_error_detail:full|signature), and the read path returns it aserrorDetail(full|signature|withheld|unrecorded) so "withheld on purpose" is never read as "nothing was recorded".$ai_*telemetry omits error text even when capture is enabled. Optional host-owned OTel run spans also use fixed code-derived messages and retainagent.error_code/agent.error_cause. - A stop that waits on the user is not an error. An
input_requiredoutcome (question, approval, connection) records theagent_runspan asstatus: "paused"with the reason interminal_code, noterror. Anything that counts failed runs must treatpausedas non-error; anerrorevent that follows the pause still makes the run an error.
From an error report to the failing run
A report is only useful if it names where it happened. Four pieces make that true, so nobody has to ask the reporter for an example:
- The failure packet. Every server
captureError()carriesextra.failureContext(app,route,actionName,automationName,threadId,runId,requestId,userScope,threadUrl, build, environment,errorCode,failureClass); see the tracking skill for how it is derived.threadUrlishttps://<app host>/?thread=<chat_threads.id>, and the Analytics issue page links it. The same fields ($ai_trace_id= run id,thread_id) are on the$ai_tracefor the run. - A copyable report on the client.
formatClientFailureReport()from@agent-native/core/client/failure-reportbuilds the plain-text packet (app, thread link, run, request, code, time, build, and the inspection call) for a "Copy details" button. The chat run-error card's existing "Copy debug info" button uses it; call it from any other error card. It needs only what the card already knows (message,errorCode,runId,requestId) and falls back to the open thread. The error-screen "Open GitHub issue" template adds the same thread link, build and time. A failed action carrieserror.requestId(the response'sx-agent-native-request-id, also on the server capture'sfailureContext.requestId). - Read by id. Dispatch's
get-agent-thread-debugta
よくある質問
設定は必要ですか?
いいえ。スキルによれば、設定なしで、すべてのエージェントの実行が自動で記録されます。
私のプロンプトの内容も記録されますか?
プロンプトとツールの内容は既定で伏せられます。記録するには、利用者が明示的に選ぶ必要があります。
データを外部のツールに送れますか?
はい。テンプレートは、Langfuse や Datadog などのサービスへ任意で書き出せます。
詳細
作者による元の説明
Agent observability, evals, feedback, and experiments. Use when adding observability dashboards, configuring trace capture, setting up evals, creating A/B experiments, or collecting user feedback on agent responses.
repo: BuilderIO/agent-native
人気
- GitHubのスター
- 7.6k
- ランキング
- #13169
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
design-exploration
7.6kUIの複数のデザインの方向性を並べて検討し、1つを選んでもらい、選んだデザインを磨き上げるようエージェントを支援します。
visual-edit
7.6k実行中のローカルのアプリをビジュアルエディターで開き、本物の画面をまとめて確認し編集できるようエージェントを支援します。
turn-into-app
7.6kワークフロー、スプレッドシート、プロジェクトを、画面にデータが入り、操作の裏でエージェントが働く、洗練されたビジュアルアプリに変えます。
visual-plan
7.6kプレーンテキストの計画を、図、ファイルのマップ、コードの断片、未解決の質問を含む、対話できるビジュアルな計画に変えます。
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。