Node/tool tracing, cost, latencyfree
Turned out to need zero extra code: LangGraph auto-traces every node and @tool call with full I/O; ChatOpenAI calls report exact token counts and cost (confirmed down to the dollar, e.g. $0.00014775 on one run).
Citation / doc usagefree
Also automatic: Agent C's node return value (source, page, content, distance) is already the recorded output of its trace — no separate logging needed.
Quality & hallucination feedbackmanual
common/observability.py's log_quality_feedback() attaches each output-guardrail result as a scored LangSmith feedback entry. Caught a real gap live: one run scored citation_presence: 0.0 — the LLM used retrieved context without naming the source.
Compliance & incidentsmanual
log_incident() — standalone, tag="incident" runs for events with no in-flight LangGraph trace at all: input/output guardrail blocks, MCP tool rejections, auth 401/403s. Verified all four land in LangSmith via direct API query, not just log output.