Skip to content

Track

Full observability for your AI agents.

The Track pillar gives you complete visibility into what your AI agents are doing — every LLM call, retrieval query, tool invocation, and chain execution captured as structured telemetry.


How It Works

graph LR
    A[Your Agent] -->|OpenTelemetry spans| B[Coalex Proxy]
    B --> C[OTel Collector]
    C --> D[Transformer]
    D --> E[Dashboard]

    style A fill:#6366f1,color:#fff
    style E fill:#3b82f6,color:#fff
  1. Instrumentauto_instrument() patches your LLM libraries to emit OpenInference spans
  2. Contextcoalex_context() wraps each request in a parent span with agent metadata
  3. Collect — Spans are exported via OTLP to the Coalex Collector
  4. Enrich — The Transformer computes token costs, PII detection, and sustainability metrics
  5. Visualize — View traces, spans, and metrics in the admin dashboard

Key Features

Feature Description
Zero-code instrumentation auto_instrument() patches 15 LLM frameworks automatically
Multi-framework support OpenAI, Anthropic, LangChain, LlamaIndex, CrewAI, and more
Custom spans Extension decorators for retrieval, embedding, reranking, tools, and guardrails
Context propagation Agent ID, request ID, and version flow through all child spans
Cost tracking Token-level cost estimation per LLM call
Sustainability metrics Energy consumption, carbon footprint (CO2eq), and primary energy

Getting Started

1. Register and instrument

import coalex

coalex.register(
    api_key="your-api-key",
    service_name="my-agent",
)
coalex.auto_instrument()

2. Declare your agent (optional)

coalex.declare_agent(agent_id="support-bot", display_name="Support Bot")

3. Wrap requests with context

with coalex.coalex_context(agent_id="support-bot", request_id="req-123"):
    response = client.chat.completions.create(
        model="gpt-4o",
        messages=[{"role": "user", "content": "Hello!"}],
    )

Every LLM call inside the context block is captured as a span, tagged with the agent ID and request ID.


Sections

  • Agents — Declaring and managing agents
  • Instrumentation — Auto-instrumentation and custom spans
  • Context — Context propagation and request scoping
  • Traces — Understanding trace structure and viewing traces
  • Metrics — Observability metrics (tokens, cost, latency, sustainability)

SDK Reference