V1 Architecture
+
+
+
+```mermaid
+graph TD
+ A[Agent Code] -->|Instrumentation| B[AgentOps SDK]
+ B -->|Creates| C[Session]
+ C -->|Initializes| D[TracerProvider]
+ C -->|Creates| E[SessionExporter]
+ D -->|Generates| F[Spans]
+ F -->|Processed by| G[BatchSpanProcessor]
+ G -->|Exports via| E
+ E -->|Sends to| H[AgentOps Backend]
+
+ subgraph "OTEL Implementation"
+ D
+ F
+ G
+ E
+ end
+```
+
+
+
+
+
+Which is pretty limited and does not take full advantage of the OpenTelemetry capabilities.
+
+---
+
+Clients might want to:
+
+- **Use Their Own OTEL Setup**
+ Many organizations already have OTEL infrastructure and might want to:
+ - Send data to multiple backends (their existing + AgentOps)
+ - Use their own sampling/batching configurations
+ - Add custom attributes/resources
+
+- **Trace Custom Metrics**
+ - LLM-specific metrics (token usage, latency, costs)
+ - Agent performance metrics (success rates, completion times)
+ - Custom business metrics
+
+
+---
+
+## Higher-level picture: AgentOps components mapping to OpenTelemetry concepts
+
+
+```mermaid
+graph LR
+ subgraph AgentOps
+ A[Session] --> B[Events]
+ B --> C[LLMEvent]
+ B --> D[ActionEvent]
+ B --> E[ToolEvent]
+ end
+
+ subgraph OpenTelemetry
+ F[Trace] --> G[Spans]
+ G --> H[LLM Spans]
+ G --> I[Action Spans]
+ G --> J[Tool Spans]
+ K[Metrics] --> L[LLM Metrics]
+ end
+
+ A -.->|Maps to| F
+ C -.->|Maps to| H
+ D -.->|Maps to| I
+ E -.->|Maps to| J
+```
+
+1. **Session → Trace**
+ - Each session represents a complete interaction/workflow
+ - Contains all related events
+ - Has a unique `session_id` (that becomes the `trace_id`)
+
+2. **Events → Spans**
+
+ Each Event naturally maps to a span because:
+ - Events have start/end times _(like spans)_
+ - Events have unique IDs _(like spans)_
+ - Events have parameters/metadata _(like span attributes)_
+ - Events are hierarchical _(like spans can be)_
+
+