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
- Instrument —
auto_instrument()patches your LLM libraries to emit OpenInference spans - Context —
coalex_context()wraps each request in a parent span with agent metadata - Collect — Spans are exported via OTLP to the Coalex Collector
- Enrich — The Transformer computes token costs, PII detection, and sustainability metrics
- 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)¶
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¶
register()— Connect to Coalexdeclare_agent()— Pre-register an agentauto_instrument()— Patch LLM frameworkscoalex_context()— Create a parent span- Extension decorators — Custom pipeline spans