From dd7707c62c7cc18e67d922fbcfb423f7cb513dda Mon Sep 17 00:00:00 2001 From: Hammad Bashir Date: Fri, 22 Mar 2024 08:44:28 -0700 Subject: [PATCH] [CLN] Add trace for memberlist update (#1912) ## Description of changes *Summarize the changes made by this PR.* - Improvements & Bug fixes - Add trace - New functionality - None ## Test plan *How are these changes tested?* - [x] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Documentation Changes None --- chromadb/segment/impl/distributed/segment_directory.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/chromadb/segment/impl/distributed/segment_directory.py b/chromadb/segment/impl/distributed/segment_directory.py index 70b766de675..d0738c054ee 100644 --- a/chromadb/segment/impl/distributed/segment_directory.py +++ b/chromadb/segment/impl/distributed/segment_directory.py @@ -10,6 +10,11 @@ from kubernetes import client, config, watch from kubernetes.client.rest import ApiException import threading +from chromadb.telemetry.opentelemetry import ( + OpenTelemetryGranularity, + add_attributes_to_current_span, + trace_method, +) from chromadb.utils.rendezvous_hash import assign, murmur3hasher @@ -226,6 +231,11 @@ def register_updated_segment_callback( ) -> None: raise NotImplementedError() + @trace_method( + "RendezvousHashSegmentDirectory._update_memberlist", + OpenTelemetryGranularity.ALL, + ) def _update_memberlist(self, memberlist: Memberlist) -> None: with self._curr_memberlist_mutex: + add_attributes_to_current_span({"new_memberlist": memberlist}) self._curr_memberlist = memberlist