Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Observability & Cost Tracking

OpenTelemetry Export

Zeph can export traces via OpenTelemetry (OTLP/gRPC). Feature-gated behind otel.

cargo build --release --features otel

Configuration

[observability]
exporter = "otlp"                        # "none" (default) or "otlp"
endpoint = "http://localhost:4317"       # OTLP gRPC endpoint

Spans

SpanAttributes
llm_callmodel
tool_exectool_name

Traces flush gracefully on shutdown. Point endpoint at any OTLP-compatible collector (Jaeger, Grafana Tempo, etc.).

Cost Tracking

Per-model cost tracking with daily budget enforcement.

Configuration

[cost]
enabled = true
max_daily_cents = 500   # Daily spending limit in cents (USD)

Built-in Pricing

ModelInput (per 1M tokens)Output (per 1M tokens)
Claude Sonnet$3.00$15.00
Claude Opus$15.00$75.00
GPT-4o$2.50$10.00
GPT-4o mini$0.15$0.60
Ollama (local)FreeFree

Budget resets at UTC midnight. When max_daily_cents is reached, LLM calls are blocked until the next reset.

Current spend is exposed as cost_spent_cents in MetricsSnapshot and visible in the TUI dashboard.