ES
Edition v1.1.0 · English & Spanish

AI AgentObservability

What you need to know about observability when you live among agents.

I wrote this book to help you take a TypeScript AI agent from fragile localhost scripts to observable production systems, with 36 runnable examples in Firebase Genkit, LangChain + LangSmith, Progress Observability Platform, and OpenTelemetry.

AI AgentObservabilityDany ParedesWhat you need to know about observabilitywhen you live among agents
24
Chapters (0-23)
4
Appendices (A-D)
36
TypeScript Examples
264
Pages (EN) · 250 (ES)

When it works or fails,do you know why?

Today we use AI to write code and build agents. When an agent works or fails, we often do not know what happened behind the scenes. In this book, I show you how to answer what it did, why it failed, and what it cost.

Failure 1

Silent 200 OK & Prompt Injection

A policy check breaks or an injection slips past filters, and server logs still report 200 OK.

Chapter 4

The Token Snowball

Multi-turn ReAct loops resend full history and reasoning tokens on every step until latency and cost spike.

Part III

Prompt Roulette

You edit two lines in a system prompt to fix one case, and three other tool flows quietly break.

Chapters 18-23

Scale, PII & MCP Gaps

Blind async hops across MCP servers, client aborts logged as 500 errors, and unmasked payment data in raw traces.

DimensionPrompting BlindlyObservable Engineering (This Book)
VisibilityFlat logs that lose context across async tool callsFull trace trees across Genkit, LangSmith, Progress & OTel
Cost & LoopsSurprise API invoice at the end of the monthPer-run token/USD accounting, prefix caching, and hard loop caps
Quality & EvalsTesting 3 prompts by hand after each editGolden Datasets, calibrated LLM judges, and CI/CD trajectory gates
Production SafetyRaw PII in traces and brittle multi-agent hops4-layer PII redaction, HITL approvals, W3C MCP traces & circuit breakers

Four complementary technologies

Vendor-neutral foundations alongside real platform instrumentation.

Firebase Genkit

Firebase Genkit

Trace defineFlow, defineTool, and ai.run spans on localhost:4000, then monitor P95 latency in Genkit Monitoring.

LangChain v1 & LangSmith

LangChain v1 & LangSmith

Inspect createAgent loops, run Golden Dataset experiments in CI/CD, filter traffic with FQL, and add HITL and PII middlewares.

Progress Observability Platform

Progress Observability Platform

Instrument @progress/observability for enterprise telemetry, real-time FinOps USD cost analytics, and automated LLM-as-a-Judge checks.

OpenTelemetry (gen_ai.*)

OpenTelemetry (gen_ai.*)

Emit portable spans, tune BatchSpanProcessor backpressure, and propagate W3C traceparent and baggage across MCP servers.

What is inside the book

Five parts that take you from initial setup to production guardrails.

Start Here & Part I

Setup & Foundations

  1. 00Before You Start: The Pieces on the Map and Environment Setup
  2. 01Coding Agents Building Agents... and It Worked. Now What?
  3. 02What an Agent Really Is: Model, Messages, Tools, Memory, and Loop
  4. 03Why Your Usual Logs Aren't Enough: From Flat Logs to Traces and Spans
  5. 04Tokens, Latency, and Cost: The Bill Nobody Explained to You
Part II

The Instrumentation Pillars

  1. 05Your First Trace with Genkit: Your Agent's "DevTools"
  2. 06Your First Trace with LangChain + LangSmith
  3. 07Anatomy of a Trace: Run Types, Metadata, Tags, and Threads
  4. 08Progress Observability Platform: Traces, FinOps Costs, and LLM-as-a-Judge
  5. 09OpenTelemetry Without Fear: The Standard Under All Three
Part III

Evaluation and Quality

  1. 10"It Seems to Work" Is Not a Metric: Datasets
  2. 11Evaluators: Code, LLM-as-a-Judge, and Their Traps
  3. 12Experiments: Changing the Prompt or Model Without Breaking Anything
  4. 13Evaluating Agents, Not Only Answers: Trajectory and Loops
  5. 14User Feedback and Human Annotation Queues
  6. 15Finding the Needle: Filtering Production Traces for Errors & Latency
Part IV

Production Operations and Scale

  1. 16Online Evaluation and Automations
  2. 17Genkit Monitoring, Dashboards, and Alerts
  3. 18Privacy and Security: What NOT to Store in Your Traces
  4. 19Production Architecture and Choosing Your Stack
  5. 20How to Ask Your AI Assistant for an Observable Agent from Day 1
Part V

Advanced Production Patterns

  1. 21Multi-Agent and MCP Observability
  2. 22Streaming and Real-Time Observability
  3. 23Semantic Caching, Guardrails, and Circuit Breakers
Appendices A to D

Reference & Checklists

  1. ABilingual Observability Glossary (ES / EN)
  2. B20-Point Production Observability Checklist
  3. CCompanion Repository & CLI Reference
  4. DFour Pillars & OpenTelemetry Cheat Sheet

Choose your edition

Read the free sample first or get the full digital edition on Leanpub.

Free Sample & Code

Free Sample + Repository

$0Free via Email & GitHub

Download the 47-page preview (Front Matter and Chapters 0 to 2) plus access to the companion TypeScript repository.

  • PDF and EPUB 3 sample sent to your inbox
  • 36 runnable TypeScript examples (Genkit, LangChain, OTel)
  • AGENTS.md, .cursorrules, CLAUDE.md & GEMINI.md pack
Open GitHub Repository
Complete Edition · Leanpub

Digital Edition (PDF + EPUB 3)

From $9.99Suggested $19.99 on Leanpub · DRM-Free

Complete v1.1.0 book (264 pp. EN / 250 pp. ES) with all chapters, appendices, and future updates.

  • All 24 chapters and 4 reference appendices
  • Screenshots and traces from Genkit, LangSmith & Progress
  • DRM-free PDF and EPUB 3 files

Extra resources & templates

Download the 3 ready-to-use Markdown templates referenced throughout the book.

Ch. 09

OpenTelemetry gen_ai.* Cheat Sheet

One-page reference of standard span names, gen_ai.* attributes, and the Four Pillars mapping table.

Ch. 19

20-Point Production Checklist

Pre-launch checklist for loop caps, BatchSpanProcessor, Golden Datasets, PII redaction, and HITL gates.

Ch. 20

AI Assistant Rules Pack

Copy-paste templates for AGENTS.md, .cursorrules, CLAUDE.md, and GEMINI.md so your AI builds observable agents from day 1.

Written by Dany Paredes (Angular GDE · Progress Champion).