<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/what-a-useful-ai-trace-should-actually-contain-build-one-4avkgyjsk" -->

---
title: What a Useful AI Trace Should Actually Contain + Build One
description: A practical implementation guide shows how to build production-grade AI traces using the Progress AI Observability Platform's Python SDK. It covers...
canonical: https://daily.dev/posts/what-a-useful-ai-trace-should-actually-contain-build-one-4avkgyjsk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: What a Useful AI Trace Should Actually Contain + Build One | daily.dev
og:description: A practical implementation guide shows how to build production-grade AI traces using the Progress AI Observability Platform's Python SDK. It covers...
og:url: https://daily.dev/posts/what-a-useful-ai-trace-should-actually-contain-build-one-4avkgyjsk
og:image: https://api.daily.dev/og/posts/4aVKgYJSk.png
og:image:alt: What a Useful AI Trace Should Actually Contain + Build One
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# What a Useful AI Trace Should Actually Contain + Build One

**[Telerik](https://daily.dev/sources/telerik)** · 9 min read · 0 upvotes · 0 comments

## Summary

A practical implementation guide shows how to build production-grade AI traces using the Progress AI Observability Platform's Python SDK. It covers auto-instrumentation of LLM libraries (OpenAI, LangChain, Anthropic, LlamaIndex), the four decorator types (agent, workflow, tool, task) for structuring traces, tagging strategies for filtering, and common pitfalls like import order and missing shutdown flushes causing lost traces. Emphasis is placed on the 'trace noise problem' where standard OpenTelemetry captures too much irrelevant infrastructure telemetry alongside AI-relevant spans, and on trade-offs like trace_content flags for PII concerns.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.telerik.com/blogs/what-useful-ai-trace-should-actually-contain-how-to-build>

## Questions this post answers

### What are the six things a useful AI trace should capture for debugging an LLM agent?

A useful AI trace should capture the prompt sent to the model, the completion returned, every tool invocation with its inputs and outputs, token counts, estimated cost, and a quality signal indicating whether the output was correct. Standard OpenTelemetry spans only show timing, parent-child relationships, and error codes, which confirms infrastructure worked but says nothing about why an agent produced a wrong answer.

_Developers instrumenting AI agents can browse implementation patterns like this one on daily.dev._

### Why does my AI agent show zero traces in my observability platform even though it ran successfully with no errors?

This usually happens because the SDK patches libraries only at the moment instrumentation is initialized, so any library like openai imported before that call never gets traced, resulting in complete silence with no errors or partial traces. It also happens in short-lived scripts or serverless functions like AWS Lambda when telemetry isn't flushed before the process exits, losing the last batch of buffered spans.

_Anyone debugging missing traces in serverless or scripted AI workflows can find similar gotchas on daily.dev._

### Why do LLM and agent spans get lost in noisy OpenTelemetry traces?

Standard OpenTelemetry auto-instrumentation instruments everything by default, so LLM calls end up mixed with HTTP client requests, authentication flows, database queries, and framework internals, since OTel does not distinguish AI-relevant spans from infrastructure spans. This is known in the AI observability community as the trace noise problem, and vendors typically address it with span filters, blocklists, or name-based selection rather than a built-in distinction.

_Teams fighting noisy AI traces can track solutions to this exact problem on daily.dev._

## Similar posts on daily.dev

- [AI Agent Observability: Logging, Tracing, and Debugging Explained](https://daily.dev/posts/ai-agent-observability-logging-tracing-and-debugging-explained-95izimukh) · Machine Learning Mastery · 1 upvotes · 0 comments
- [Debugging the undebuggable: building observability into probabilistic AI systems](https://daily.dev/posts/debugging-the-undebuggable-building-observability-into-probabilistic-ai-systems-rtv9f3rej) · The New Stack · 2 upvotes · 0 comments
- [From Prototype to Production — Observability and Auditability \(Part 6\)](https://daily.dev/posts/from-prototype-to-production-observability-and-auditability-part-6--2zmkplcj0) · ITNEXT · 0 upvotes · 0 comments
- [You can’t debug what you can’t see — Observability for AI Agents](https://daily.dev/posts/you-can-t-debug-what-you-can-t-see-observability-for-ai-agents-8yaiqpabv) · CNCF · 1 upvotes · 0 comments
- [Why Your AI Agent is a Black Box and How to fix it With OpenTelemetry](https://daily.dev/posts/why-your-ai-agent-is-a-black-box-and-how-to-fix-it-with-opentelemetry-oakutrahj) · DevOps.com · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#llm](https://daily.dev/tags/llm), [#ai-agents](https://daily.dev/tags/ai-agents), [#observability](https://daily.dev/tags/observability), [#opentelemetry](https://daily.dev/tags/opentelemetry)

[View this post on daily.dev](https://daily.dev/posts/what-a-useful-ai-trace-should-actually-contain-build-one-4avkgyjsk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"What a Useful AI Trace Should Actually Contain + Build One","url":"https://daily.dev/posts/what-a-useful-ai-trace-should-actually-contain-build-one-4avkgyjsk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/what-a-useful-ai-trace-should-actually-contain-build-one-4avkgyjsk"},"datePublished":"2026-08-19T18:46:48.762Z","dateModified":"2026-09-14T07:31:23.492Z","description":"A practical implementation guide shows how to build production-grade AI traces using the Progress AI Observability Platform's Python SDK. It covers...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f4a7830ce14d64cbcc89ed7247f6a784?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f4a7830ce14d64cbcc89ed7247f6a784?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Telerik","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Telerik","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/5ee6d4bef8ac4f84886d06f5881963e7","url":"https://daily.dev/sources/telerik"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/what-a-useful-ai-trace-should-actually-contain-build-one-4avkgyjsk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,llm,ai-agents,observability,opentelemetry","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Telerik","item":"https://daily.dev/sources/telerik"},{"@type":"ListItem","position":3,"name":"What a Useful AI Trace Should Actually Contain + Build One"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/what-a-useful-ai-trace-should-actually-contain-build-one-4avkgyjsk#faq","mainEntity":[{"@type":"Question","name":"What are the six things a useful AI trace should capture for debugging an LLM agent?","acceptedAnswer":{"@type":"Answer","text":"A useful AI trace should capture the prompt sent to the model, the completion returned, every tool invocation with its inputs and outputs, token counts, estimated cost, and a quality signal indicating whether the output was correct. Standard OpenTelemetry spans only show timing, parent-child relationships, and error codes, which confirms infrastructure worked but says nothing about why an agent produced a wrong answer. Developers instrumenting AI agents can browse implementation patterns like this one on daily.dev."}},{"@type":"Question","name":"Why does my AI agent show zero traces in my observability platform even though it ran successfully with no errors?","acceptedAnswer":{"@type":"Answer","text":"This usually happens because the SDK patches libraries only at the moment instrumentation is initialized, so any library like openai imported before that call never gets traced, resulting in complete silence with no errors or partial traces. It also happens in short-lived scripts or serverless functions like AWS Lambda when telemetry isn't flushed before the process exits, losing the last batch of buffered spans. Anyone debugging missing traces in serverless or scripted AI workflows can find similar gotchas on daily.dev."}},{"@type":"Question","name":"Why do LLM and agent spans get lost in noisy OpenTelemetry traces?","acceptedAnswer":{"@type":"Answer","text":"Standard OpenTelemetry auto-instrumentation instruments everything by default, so LLM calls end up mixed with HTTP client requests, authentication flows, database queries, and framework internals, since OTel does not distinguish AI-relevant spans from infrastructure spans. This is known in the AI observability community as the trace noise problem, and vendors typically address it with span filters, blocklists, or name-based selection rather than a built-in distinction. Teams fighting noisy AI traces can track solutions to this exact problem on daily.dev."}}]}
```

