diff --git a/chromadb/server/fastapi/__init__.py b/chromadb/server/fastapi/__init__.py index be583c1206f..5a04c5c5ba7 100644 --- a/chromadb/server/fastapi/__init__.py +++ b/chromadb/server/fastapi/__init__.py @@ -710,17 +710,20 @@ async def get_collection( add_attributes_to_current_span({"tenant": tenant}) - api_collection_model = cast( - CollectionModel, - await to_thread.run_sync( - self._api.get_collection, - collection_name, - tenant, - database_name, - limiter=self._capacity_limiter, - ), - ) - return api_collection_model + @trace_method("Outside the pool", OpenTelemetryGranularity.OPERATION) + def inner(): + api_collection_model = cast( + CollectionModel, + await to_thread.run_sync( + self._api.get_collection, + collection_name, + tenant, + database_name, + limiter=self._capacity_limiter, + ), + ) + return api_collection_model + return inner() @trace_method("FastAPI.update_collection", OpenTelemetryGranularity.OPERATION) async def update_collection(