惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
J
Java Code Geeks
I
InfoQ
腾讯CDC
Vercel News
Vercel News
IT之家
IT之家
V
Visual Studio Blog
P
Proofpoint News Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 叶小钗
有赞技术团队
有赞技术团队
月光博客
月光博客
Martin Fowler
Martin Fowler
量子位
L
LangChain Blog
B
Blog
Last Week in AI
Last Week in AI
博客园 - 司徒正美
Microsoft Security Blog
Microsoft Security Blog
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans

InfoQ

GitHub Copilot Open-Source Project Brings Full iOS 27 Virtualization to Apple Silicon From Retrieval to Reasoning: Building Production-Ready Agentic AI Systems with Knowledge Graphs Lambda SnapStart Comes to Container Images, Ending a Packaging Tradeoff One Decade of Rustls: Evolution, Benchmarks, and Future Roadmap NVIDIA Personal AI Router Distributes AI Tasks across Local Compute Netflix Reworks Conductor for 420 Million Monthly Workflow Executions and 10X Larger Workflows tsgolint Reaches Stable v7, Bringing Go-Powered Type-Aware Linting to Oxlint Terraform AWS Provider Continues Rapid Expansion as AWS Infrastructure Becomes More Complex How To Run on Three Clouds at Once, and When Not To How LinkedIn Trains AI Job Search 8x Faster with Multi-Teacher Distillation Advancing Embedded Go: Recoverable Panics, UEFI, Radio and Hardware Dev Kit Blume: Zero-Config Docs Framework That Turns a Markdown Folder into an AI-Ready Website Redefining GIS: Declarative Symbology and Collaborative Workflows in JupyterGIS Airbnb Cuts Authentication Code by 60% with Server Driven Architecture Kubernetes Promotes KYAML as a Safer, More Consistent Way to Work with Manifests Next-Gen Architecture Playbook: Insights and Patterns for the AI Era From S3 to GPU in One Copy: Rethinking Data Loading for ML Training Copilot Code Review Reaches Azure Repos, Billed Per Review with Reporting Two Days Behind Personality Over Skillset: How Adam Wachtel Builds Engineering Teams Tether: Apple Continuity Like Experience Between iOS and Linux Desktop Machines Twenty Years of jQuery: How a Little Library Rewired Web Development Shopify Introduces Gisting: Compressing LLM System Prompts into Learned Tokens Rigorous Yet Sustainable Human Reviews in the AI Era pnpm 12 Rewrites Package Manager in Rust, Accelerating Installs While Preserving pnpm 11 Workflows Instrumentation at Scale: Having Your Performance Cake and Eating It Too Cohere’s Parse 5 Promises Efficient Multi-Modal Information Extraction From Complex Documents Swiggy Uses 350+ Features and Multi-Task MLP to Predict Customer Lifetime Value OpenAI Details GPT-Live’s Architecture for Continuous Stateful Voice Interaction Beyond Prompting: Context Engineering for Production-Grade AI
Session Traces and Cost Controls Help Diagnose AI Agent F...
Mark Silvester · 2026-09-11 · via InfoQ

An agent can repeatedly call the wrong tool without triggering an availability alert.

In a CNCF member post published on 4 August, StackGen principal engineer Sabith K Soopy described how session traces and cost controls help teams investigate repeated tool calls and unexpected spending.

Drawing on months of operating agents in production, the post notes: "The hardest part isn’t building them; it’s understanding what they’re doing when they go wrong." Standard application monitoring indicates whether a service responds, but fails to explain why an autonomous workflow loops, calls invalid endpoints or claims to complete work it skipped.

StackGen uses Langfuse to capture nested session traces. Each large language model (LLM) call, tool execution and sub-agent delegation is recorded as an individual span with execution latency and token costs attached. Nesting child spans beneath parent traces preserves the full delegation chain across complex multi-agent workflows. The post recommends an asynchronous batch exporter that queues spans in memory and flushes them periodically, ensuring a temporary telemetry backend outage drops trace data rather than blocking running agents.

Cost controls operate as the primary operational safeguard against runaway execution. The post recommends enforcing hard iteration caps and per-tool call limits before execution begins, paired with pre-execution checks that block identical consecutive tool requests.

While consecutive-call blocking addresses simple repetitions, teams combine it with statistical monitoring. Comparing session costs against each agent’s rolling average flags slower anomalies, including model-routing errors, tool hallucinations and unbounded context expansion across multi-turn interactions. The post argues that reactive alerts alone arrive too late for fast-running parallel agents.

For post-incident review, the post recommends writing tool calls, governance decisions and memory operations to an append-only, searchable log with credentials and personally identifiable information redacted before storage. StackGen complements this with a command-line diagnostic tool that validates model API access, vector database reachability, pending approvals, memory counts, trace backend connections and integration health in a single execution.

Completed traces pass through automated analysers that flag execution duration, tool failures, retry counts and token efficiency issues for human review. The post recommends exporting bounded operational metrics, such as tool error rates and approval latency histograms, to Prometheus. It warns that putting dynamic session IDs into metric labels creates high-cardinality time series that can crash metric servers, noting that granular session context belongs strictly in traces or structured logs. As the post puts it: "Traces are for debugging, metrics are for alerting."

Complementary tooling provides structured paths for evaluating trace data across production environments. OpenTelemetry’s generative AI semantic conventions define standardised attributes for model operations, token consumption and tool invocations, establishing a consistent schema across telemetry backends. A trace records execution history, while evaluation tools verify output quality. LangSmith converts anomalous production traces into test datasets for regression benchmarking and quality monitoring. Open-source Arize Phoenix pairs OpenTelemetry-native tracing with self-hosted LLM-as-a-judge evaluation and prompt experimentation. The OpenTelemetry project maintains these specifications in a dedicated repository covering client, server, and Model Context Protocol spans to support consistent multi-vendor observability.

About the Author

Mark Silvester