observability
Skill này làm gì
Skill này mô tả khả năng quan sát tích hợp sẵn cho các lần chạy agent, ghi lại trace, đánh giá và phản hồi của người dùng. Dữ liệu được giữ trong cơ sở dữ liệu của ứng dụng. Skill dành cho lập trình viên muốn xem agent của họ hoạt động thế nào và vì sao.
Khi nào nên dùng
- ✓Khi bạn muốn xem điều gì đã xảy ra trong một lần chạy agent, từng bước một.
- ✓Khi bạn muốn thu thập phản hồi về các câu trả lời của agent.
- ✓Khi bạn cần thiết lập đánh giá hoặc một thử nghiệm A hoặc B cho agent.
Liên kết skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/observability/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể cho tôi thấy agent đã xử lý các cuộc chat gần đây ra sao, gồm những công cụ nào nó đã gọi và mỗi bước mất bao lâu không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Mọi lần chạy agent đều được ghi lại tự động cùng các bước, lời gọi mô hình và lời gọi công cụ. Nội dung được ẩn theo mặc định, và dữ liệu được lưu trong cơ sở dữ liệu của chính ứng dụng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Có cần thiết lập gì không?
Không. Skill nói mọi lần chạy agent đều được đo đạc tự động mà không cần cấu hình.
Nội dung prompt của tôi có được ghi lại không?
Prompt và nội dung công cụ được che mặc định, và bạn phải chủ động chọn để ghi lại chúng.
Dữ liệu có thể gửi đến công cụ bên ngoài không?
Có. Skill nói các template có thể tùy chọn xuất sang dịch vụ như Langfuse hoặc Datadog.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 7.6k
- Vị trí xếp hạng
- #13169
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
design-exploration
7.6kGiúp agent của bạn khám phá nhiều hướng thiết kế giao diện song song, để bạn chọn một hướng rồi tinh chỉnh thiết kế đã chọn.
visual-edit
7.6kGiúp agent của bạn mở một ứng dụng cục bộ đang chạy trong trình chỉnh sửa trực quan, để bạn xem và sửa các màn hình thật cùng nhau.
turn-into-app
7.6kBiến quy trình, bảng tính hoặc dự án thành ứng dụng trực quan có màn hình đầy đủ dữ liệu, với agent làm việc phía sau các điều khiển.
visual-plan
7.6kBiến một kế hoạch viết bằng văn bản thuần thành kế hoạch trực quan tương tác, có sơ đồ, bản đồ file, đoạn code và các câu hỏi còn mở.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.