/claim #2456
Fixes: #2456
- I have added tests that cover my changes.
- If adding a new instrumentation or changing an existing one, I’ve added screenshots from some observability platform showing the change.
- PR name follows conventional commits format:
feat(instrumentation): ...
or fix(instrumentation): ...
.
- (If applicable) I have updated the documentation accordingly.
Description
This PR adds event-based tracking implementation across multiple providers while maintaining backward compatibility with the legacy attribute-based approach.
Completed Implementations:
- ✅ Anthropic
- ✅ Bedrock
- ✅ Cohere
- ✅ Google GenerativeAI
- ✅ Groq
- ✅ Langchain
- ✅ LlamaIndex
- ✅ MistralAI
- ✅ Ollama
- ✅ Replicate
Pending Implementations:
- 🔄 SageMaker
- 🔄 Together
- 🔄 Transformers
- 🔄 VertexAI
- 🔄 WatsonX
Key Changes:
- Added event-based configuration with
use_legacy_attributes
support
- Implemented event utilities for:
- Prompts
- Completions
- Embeddings (where applicable)
- Tool/Function calls (where applicable)
- Added comprehensive test coverage for event emission
- Added support for both sync and async clients
- Added streaming support where applicable
- Maintained backward compatibility with legacy mode
Each provider implementation includes:
- Event utilities (
events.py
)
- Configuration updates (
config.py
)
- Core instrumentation updates (
__init__.py
)
- Comprehensive test coverage (
test_events.py
)