Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)7.6k · #13169

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.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/observability/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

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. captureToolResults only decides whether the rest is kept. The span's metadata says which (__tool_error_detail: full | signature), and the read path returns it as errorDetail (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 retain agent.error_code / agent.error_cause.
  • A stop that waits on the user is not an error. An input_required outcome (question, approval, connection) records the agent_run span as status: "paused" with the reason in terminal_code, not error. Anything that counts failed runs must treat paused as non-error; an error event 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() carries extra.failureContext (app, route, actionName, automationName, threadId, runId, requestId, userScope, threadUrl, build, environment, errorCode, failureClass); see the tracking skill for how it is derived. threadUrl is https://<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_trace for the run.
  • A copyable report on the client. formatClientFailureReport() from @agent-native/core/client/failure-report builds 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 carries error.requestId (the response's x-agent-native-request-id, also on the server capture's failureContext.requestId).
  • Read by id. Dispatch's get-agent-thread-debug ta
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

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự