TypeScriptADK-TS

Observability

Comprehensive OpenTelemetry integration for distributed tracing, metrics, and monitoring of AI agents

ADK-TS provides first-class observability support through comprehensive OpenTelemetry integration. Monitor your agents' performance, trace execution flows, collect metrics, and gain insights into LLM interactions, tool usage, and agent behavior.

Overview

The observability system in ADK-TS is built on OpenTelemetry, providing:

  • Distributed Tracing - Track agent invocations, tool executions, and LLM calls across your system
  • Metrics Collection - Monitor performance with counters, histograms, and token usage tracking
  • Auto-Instrumentation - Automatic tracing of HTTP calls, database queries, and file operations
  • Privacy Controls - Configurable content capture for production environments
  • Platform Integration - Works with Jaeger, Grafana, Datadog, New Relic, Honeycomb, and more

Built-in Support

All telemetry dependencies are included in @iqai/adk. No additional installation required.

Quick Example

import { telemetryService } from "@iqai/adk";

// Initialize telemetry
await telemetryService.initialize({
  appName: "my-agent-app",
  appVersion: "1.0.0",
  otlpEndpoint: "http://localhost:4318/v1/traces",
  enableMetrics: true,
  enableTracing: true,
});

// Your agents automatically send traces and metrics
const agent = AgentBuilder.withModel("gemini-2.5-flash").build();
const response = await agent.ask("Hello!");

Architecture

The observability system follows a modular architecture:

Application

TelemetryService
    ├─ Setup Service
    ├─ Tracing Service
    ├─ Metrics Service
    └─ Utilities

OpenTelemetry SDK
    ├─ TracerProvider
    └─ MeterProvider

OTLP Exporters
    ├─ Trace Exporter
    └─ Metric Exporter

Backend (Jaeger, Tempo, etc.)

Next Steps