What is AI Observability?
AI observability is the practice of monitoring, understanding, and debugging AI applications in production. For LLM-based applications, this means tracking:- What - The inputs and outputs of AI model calls
- How - Performance metrics like latency and token usage
- How much - Cost attribution and spending
- Why - Error tracking and debugging information
OpenTelemetry
Anyway is built on OpenTelemetry (OTel), the industry-standard framework for observability. OTel provides:- Vendor-neutral instrumentation
- Standard data formats
- Wide ecosystem support
Traces
A trace represents a single logical operation in your application, such as handling a user request. Traces help you understand the flow of requests through your system.Trace ID
Every trace has a unique ID that allows you to correlate all operations related to a single request:Spans
A span represents a single operation within a trace. Spans have:- Name - What operation is being performed
- Start time - When it began
- Duration - How long it took
- Attributes - Key-value metadata
- Status - Success or error
Span Hierarchy
Spans can be nested to show parent-child relationships:Span Attributes
Attributes provide context about each operation. For LLM spans, these follow the OpenTelemetry GenAI semantic conventions:Workflows and Tasks
The Anyway SDK uses workflows and tasks to create structured trace hierarchies:- Python
- JavaScript
Metrics
Metrics are numerical measurements aggregated over time. Unlike traces (which capture individual requests), metrics summarize patterns:- Counter - Values that only increase (total requests, total tokens)
- Gauge - Point-in-time values (queue size, active connections)
- Histogram - Distribution of values (latency percentiles)
Semantic Conventions
Anyway follows the OpenTelemetry GenAI semantic conventions for standardized attribute names:| Attribute | Description |
|---|---|
gen_ai.system | Provider (openai, anthropic) |
gen_ai.request.model | Requested model |
gen_ai.response.model | Model used in response |
gen_ai.usage.prompt_tokens | Input token count |
gen_ai.usage.completion_tokens | Output token count |
gen_ai.usage.cost | Estimated total cost (USD) |
Next Steps
Quickstart
Get started with Anyway in 5 minutes.
Tracing
Deep dive into distributed tracing.