Agent Observability
Monitor, trace, and debug your AI agents with production-grade observability tools.
Production AI agents need visibility into their behavior, performance, and errors. This guide covers essential observability tools for logging, distributed tracing, and metrics collection — helping you understand what your agents are doing and why.
💡 Before deploying: Use Agent Diagnostics to validate your configuration, or Trace Viewer to inspect live agent runs.
Vendor-neutral observability framework for distributed tracing, metrics, and logs.
Installation
npm install @opentelemetry/api @opentelemetry/sdk-nodeQuick Start
// Setup OpenTelemetry
import { NodeSDK } from '@opentelemetry/sdk-node';
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
const sdk = new NodeSDK({
traceExporter: new ConsoleSpanExporter(),
instrumentations: [getNodeAutoInstrumentations()]
});
sdk.start();Fast, low-overhead JSON logger for Node.js applications.
Installation
npm install pino pino-prettyQuick Start
// Setup Pino logger
import pino from 'pino';
const logger = pino({
level: process.env.LOG_LEVEL || 'info',
transport: {
target: 'pino-pretty',
options: { colorize: true }
}
});
logger.info({ agentId: '123' }, 'Agent started');Versatile logging library with multiple transports and formatting options.
Installation
npm install winstonQuick Start
// Setup Winston logger
import winston from 'winston';
const logger = winston.createLogger({
level: 'info',
format: winston.format.json(),
transports: [
new winston.transports.File({ filename: 'error.log', level: 'error' }),
new winston.transports.File({ filename: 'combined.log' })
]
});Time-series database and monitoring system with powerful query language.
Installation
npm install prom-clientQuick Start
// Setup Prometheus metrics
import client from 'prom-client';
const register = new client.Registry();
const counter = new client.Counter({
name: 'agent_requests_total',
help: 'Total agent requests',
registers: [register]
});
counter.inc();End-to-end distributed tracing for monitoring and troubleshooting microservices.
Installation
npm install jaeger-clientQuick Start
// Setup Jaeger tracer
import { initTracer } from 'jaeger-client';
const config = {
serviceName: 'my-agent',
sampler: { type: 'const', param: 1 }
};
const tracer = initTracer(config);Full-stack observability platform with APM, logs, and infrastructure monitoring.
Installation
npm install dd-traceQuick Start
// Setup Datadog APM
import tracer from 'dd-trace';
tracer.init({
service: 'my-agent',
env: process.env.NODE_ENV,
logInjection: true
});Error tracking and performance monitoring for production applications.
Installation
npm install @sentry/nodeQuick Start
// Setup Sentry error tracking
import * as Sentry from '@sentry/node';
Sentry.init({
dsn: process.env.SENTRY_DSN,
tracesSampleRate: 1.0,
});Log aggregation system designed to store and query logs efficiently.
Installation
npm install pino-lokiQuick Start
// Setup Loki transport
import pino from 'pino';
import pinoLoki from 'pino-loki';
const logger = pino(pinoLoki({
host: 'http://localhost:3100',
labels: { app: 'my-agent' }
}));| Tool | Node.js | Python | Java | Go |
|---|---|---|---|---|
| OpenTelemetry | ✅ | ✅ | ✅ | ✅ |
| Pino | ✅ | — | — | — |
| Winston | ✅ | — | — | — |
| Prometheus | ✅ | ✅ | ✅ | ✅ |
| Jaeger | ✅ | ✅ | ✅ | ✅ |
| Datadog | ✅ | ✅ | ✅ | ✅ |
| Sentry | ✅ | ✅ | ✅ | ✅ |
| Grafana Loki | ✅ | ✅ | — | ✅ |