All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
agent_context(): new context manager for OTel GenAI semantic-convention agent identity attributes (gen_ai.agent.id,gen_ai.agent.name,gen_ai.agent.description,gen_ai.agent.version). All spans created inside the context are auto-tagged byLast9SpanProcessor, matching the shape OpenAI Agents SDK andautogen-coreemit natively on their own agent spans.agent_contextcomposes withconversation_context()andworkflow_context(); covered by tests for triple-nesting, multi-agent handoff (same conversation), inner-overrides-outer, and mixed-exit order.
agent_nameis the only required argument (per OTel semconv).agent_id/agent_description/agent_versionare optional.- Native-instrumented agent spans (e.g. AutoGen's
invoke_agent, OpenAI Agents SDK) setgen_ai.agent.*directly inside the span body and will override values fromagent_context. Sibling and child spans still receiveagent_context's values.
Last9LogToSpanProcessor: new OTelLogRecordProcessorthat promotes GenAI log events emitted byopentelemetry-instrumentation-openai-v2(new GenAI semconv) onto the currently active span as both flat span attributes and indexed attributes so the Last9 LLM dashboard renders prompts, completions, and tool calls.- Flat attrs:
gen_ai.prompt,gen_ai.completion(JSON arrays) - Span events:
gen_ai.content.prompt,gen_ai.content.completion - Indexed attrs:
gen_ai.prompt.{i}.*,gen_ai.completion.{i}.*(AgentOps / Traceloop compatible)
- Flat attrs:
Last9SpanProcessornow accepts an optionallog_processor=kwarg; per-span counter state in the bridge is released when its span ends.
- LLM dashboard now shows user/assistant/tool messages for apps using the new GenAI semconv (openai-v2) — previously these payloads were only emitted as log records and never reached the dashboard.
- Python 3.14 users must pin
wrapt<2becauseopentelemetry-instrumentation-openai-v22.3b0 callswrap_function_wrapper(module=..., name=..., wrapper=...)and wrapt 2.0 renamed the first kwarg totarget=. Without the pin, instrumentation fails silently and no log events are emitted.
- Initial open source release of Last9 Python AI SDK
- Cost Tracking: Automatic cost calculation for 20+ AI models
- Anthropic: Claude 3.5 Sonnet, Claude 3 Opus, Claude 3 Haiku
- OpenAI: GPT-4o, GPT-4 Turbo, GPT-4, GPT-3.5 Turbo
- Google: Gemini Pro, Gemini 1.5 Pro, Gemini 1.5 Flash
- Cohere: Command R, Command R+
- And more...
- Conversation Tracking: Multi-turn conversation tracking with
gen_ai.conversation.id - Workflow Management: Cost aggregation across multi-step workflows
- Span Classification:
gen_ai.l9.span.kindfor filtering (llm/tool/prompt) - Prompt Versioning: Hash-based prompt template tracking and versioning
- Tool/Function Tracking: Enhanced attributes for tool and function calls
- Performance Metrics: Response times, request/response sizes, quality scores
- Content Events: Input/output prompts as span events
- Standard Compliance: Full compatibility with OpenTelemetry GenAI v1.28.0 conventions
- Comprehensive README with usage examples
- Installation guide (INSTALL.md)
- Complete API reference
- Working examples:
- Basic usage with cost tracking
- Anthropic Claude SDK integration
- Conversation tracking with multi-turn support
- Tool and function call tracking
- Built on OpenTelemetry Python SDK
- Requires Python >=3.9 (aligned with OpenTelemetry API requirements)
- Zero dependencies beyond OpenTelemetry
- Works with any OTLP-compatible backend
- Feature parity with last9-node-agent
- OpenAI Python SDK
- Anthropic Python SDK
- LangChain (via examples)
- FastAPI (via examples)
- Framework-agnostic design
- MAJOR version for incompatible API changes
- MINOR version for new functionality in a backwards compatible manner
- PATCH version for backwards compatible bug fixes
For more information, see the SPEC.md document.