feat(crewai): Enable Tracing Support For CrewAI Metrics #2377
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds tracing support for CrewAI to capture & expose metrics associated with short & long-term memory operations.
Memory Events
Memory Attributes
LongTermMemorySave
LongTermMemorySearch
ShortTermMemorySave
ShortTermMemorySearch
Closes #2207
Note
Adds tracing for CrewAI short/long-term memory save/search with event attributes and timings, and updates the example to enable SQLite-backed long-term memory.
LongTermMemory.save/searchandShortTermMemory.save/searchthat log structured span events with flattened attributes and timing metrics._log_span_eventto add events and prefixed attributes to the active span.CrewAIInstrumentor_instrumentand cleanly restore in_uninstrument._flattento joinList[str]values.examples/research_writer_crew.pywithLongTermMemoryusingLTMSQLiteStorageatcrewai_storage/memory.db; add project-local storage path setup.Written by Cursor Bugbot for commit 25fb654. This will update automatically on new commits. Configure here.