Skip to main content

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.

OpenTelemetry
tracing
Node.jsPythonJavaGo

Vendor-neutral observability framework for distributed tracing, metrics, and logs.

Installation

npm install @opentelemetry/api @opentelemetry/sdk-node

Quick 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();
Pino
logging
Node.js

Fast, low-overhead JSON logger for Node.js applications.

Installation

npm install pino pino-pretty

Quick 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');
Winston
logging
Node.js

Versatile logging library with multiple transports and formatting options.

Installation

npm install winston

Quick 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' })
  ]
});
Prometheus
metrics
Node.jsPythonGoJava

Time-series database and monitoring system with powerful query language.

Installation

npm install prom-client

Quick 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();
Jaeger
tracing
Node.jsPythonGoJava

End-to-end distributed tracing for monitoring and troubleshooting microservices.

Installation

npm install jaeger-client

Quick Start

// Setup Jaeger tracer
import { initTracer } from 'jaeger-client';

const config = {
  serviceName: 'my-agent',
  sampler: { type: 'const', param: 1 }
};

const tracer = initTracer(config);
Datadog
metrics
Node.jsPythonJavaGo

Full-stack observability platform with APM, logs, and infrastructure monitoring.

Installation

npm install dd-trace

Quick Start

// Setup Datadog APM
import tracer from 'dd-trace';

tracer.init({
  service: 'my-agent',
  env: process.env.NODE_ENV,
  logInjection: true
});
Sentry
logging
Node.jsPythonJavaGo

Error tracking and performance monitoring for production applications.

Installation

npm install @sentry/node

Quick Start

// Setup Sentry error tracking
import * as Sentry from '@sentry/node';

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  tracesSampleRate: 1.0,
});
Grafana Loki
logging
Node.jsPythonGo

Log aggregation system designed to store and query logs efficiently.

Installation

npm install pino-loki

Quick 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' }
}));
Integration Matrix
ToolNode.jsPythonJavaGo
OpenTelemetry
Pino
Winston
Prometheus
Jaeger
Datadog
Sentry
Grafana Loki