소스 정보
- 저장소
- nexus-labs-automation/agent-observability
- 최근 소스 활동
- 2025년 12월 26일 23:35
- 감지된 SKILL.md 언어
- 영어
- 스타
- 7
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/nexus-labs-automation/agent-observability --skill tool-call-tracking명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Trace agent decision-making, tool selection, and reasoning chains
Instrument safety checks, content filters, and guardrails for agent outputs
Strategies for evaluating agents in production - sampling, baselines, and regression detection
SOC 직업 분류 기준
SKILL.md 표시 중
| name | tool-call-tracking |
| description | Instrument agent tool executions with proper context and error handling |
| triggers | ["track tool calls","instrument tools","tool execution spans","function call tracing"] |
| priority | 1 |
Instrument tool/function executions to understand what agents do and why they fail.
Tools are where agents interact with the real world. Track:
# Required (P0)
span.set_attribute("tool.name", "web_search")
span.set_attribute("tool.success", True)
span.set_attribute("tool.latency_ms", 450)
# Safe argument summary (P1)
span.set_attribute("tool.args.query", "weather in NYC") # Safe to log
span.set_attribute("tool.args.count", 3) # Summarize, don't dump
# Result summary (P1)
span.set_attribute("tool.result.type", "search_results")
span.set_attribute("tool.result.count", 10)
span.set_attribute("tool.result.length", 2500)
# Error context (when applicable)
span.set_attribute("tool.error.type", "timeout")
span.set_attribute("tool.error.message", "Request timed out after 30s")
# BAD - Full arguments (PII risk, unbounded size)
span.set_attribute("tool.args", json.dumps(args))
span.set_attribute("tool.result", json.dumps(result))
# BAD - Sensitive tool arguments
span.set_attribute("tool.args.api_key", api_key)
span.set_attribute("tool.args.password", password)
# GOOD - Safe summaries
span.set_attribute("tool.args.has_credentials", True)
span.set_attribute("tool.result.success", True)
Different tools need different instrumentation:
span.set_attribute("tool.name", "vector_search")
span.set_attribute("tool.retrieval.query_length", len(query))
span.set_attribute("tool.retrieval.results_count", len(results))
span.set_attribute("tool.retrieval.top_score", results[0].score)
span.set_attribute("tool.name", "http_request")
span.set_attribute("tool.http.method", "POST")
span.set_attribute("tool.http.url", sanitize_url(url)) # Remove query params
span.set_attribute("tool.http.status", 200)
span.set_attribute("tool.name", "sql_query")
span.set_attribute("tool.db.operation", "SELECT")
span.set_attribute("tool.db.table", "users")
span.set_attribute("tool.db.rows_affected", 5)
span.set_attribute("tool.name", "read_file")
span.set_attribute("tool.file.path", sanitize_path(path))
span.set_attribute("tool.file.size_bytes", 1024)
span.set_attribute("tool.file.type", "text/plain")
span.set_attribute("tool.name", "python_repl")
span.set_attribute("tool.code.lines", 15)
span.set_attribute("tool.code.has_imports", True)
span.set_attribute("tool.execution.exit_code", 0)
Generic tool wrapper for consistent instrumentation:
from functools import wraps
from langfuse.decorators import observe
def traced_tool(tool_name: str):
def decorator(func):
@wraps(func)
@observe(name=f"tool.{tool_name}")
def wrapper(*args, **kwargs):
span = get_current_span()
span.set_attribute("tool.name", tool_name)
try:
result = func(*args, **kwargs)
span.set_attribute("tool.success", True)
return result
except Exception as e:
span.set_attribute("tool.success", False)
span.set_attribute("tool.error.type", type(e).__name__)
span.set_attribute("tool.error.message", str(e)[:500])
raise
return wrapper
return decorator
@traced_tool("web_search")
def search_web(query: str) -> list:
# Tool implementation
pass
from langchain.tools import tool
from langfuse.decorators import observe
@tool
@observe(name="tool.calculator")
def calculator(expression: str) -> float:
"""Evaluate math expression."""
return eval(expression)
from crewai import Agent
from langfuse.decorators import observe
@observe(name="tool.research")
def research_tool(topic: str) -> str:
# Implementation
pass
Track error types for better debugging:
ERROR_CATEGORIES = {
"timeout": ["TimeoutError", "ReadTimeout"],
"rate_limit": ["RateLimitError", "TooManyRequests"],
"auth": ["AuthenticationError", "PermissionDenied"],
"validation": ["ValidationError", "InvalidInput"],
"network": ["ConnectionError", "NetworkError"],
"internal": ["InternalError", "ServerError"],
}
See references/anti-patterns/tool-tracing.md:
error-retry-tracking - Error handling patternsllm-call-tracing - LLM-specific instrumentation