Skip to content

Commit

Permalink
[CLN] Add trace for memberlist update (#1912)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
HammadB authored Mar 22, 2024
1 parent e2ee34e commit dd7707c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions chromadb/segment/impl/distributed/segment_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit dd7707c

Please sign in to comment.