@@ -33,6 +33,11 @@ fn is_transient_lock_error(message: &str) -> bool {
3333pub fn open_kindb_snapshot (
3434 layout : & kin_core:: KinLayout ,
3535) -> std:: result:: Result < kin_db:: SnapshotManager , kin_db:: KinDbError > {
36+ let _span = tracing:: info_span!(
37+ "kindb.open_snapshot" ,
38+ path = %kindb_snapshot_path( layout) . display( )
39+ )
40+ . entered ( ) ;
3641 let path = kindb_snapshot_path ( layout) ;
3742 let mut attempts = 0usize ;
3843 let mut delay = Duration :: from_millis ( SNAPSHOT_OPEN_INITIAL_DELAY_MS ) ;
@@ -72,6 +77,11 @@ pub fn vector_index_path(layout: &kin_core::KinLayout) -> PathBuf {
7277pub async fn open_snapshot_daemon_first (
7378 layout : & kin_core:: KinLayout ,
7479) -> std:: result:: Result < kin_db:: SnapshotManager , kin_db:: KinDbError > {
80+ let _span = tracing:: info_span!(
81+ "kin.backend.open_snapshot_daemon_first" ,
82+ snapshot = %kindb_snapshot_path( layout) . display( )
83+ )
84+ . entered ( ) ;
7585 // Respect explicit offline mode
7686 if std:: env:: var ( "KIN_OFFLINE" ) . is_ok ( ) {
7787 return open_kindb_snapshot ( layout) ;
@@ -93,6 +103,11 @@ pub async fn open_snapshot_daemon_first(
93103/// Non-fatal: if the file doesn't exist or fails to load, semantic search
94104/// gracefully returns empty results.
95105fn load_vector_index_if_exists ( snap : & kin_db:: SnapshotManager , layout : & kin_core:: KinLayout ) {
106+ let _span = tracing:: info_span!(
107+ "kindb.load_vector_index_if_exists" ,
108+ path = %vector_index_path( layout) . display( )
109+ )
110+ . entered ( ) ;
96111 let path = vector_index_path ( layout) ;
97112 if path. exists ( ) {
98113 let graph = snap. graph ( ) ;
@@ -112,6 +127,7 @@ fn load_vector_index_if_exists(snap: &kin_db::SnapshotManager, layout: &kin_core
112127/// Fetch the graph from the daemon's `/graph/bootstrap` endpoint.
113128/// Returns `None` if the daemon is unreachable or returns an error.
114129async fn fetch_daemon_graph ( ) -> Option < kin_db:: InMemoryGraph > {
130+ let _span = tracing:: info_span!( "kin.backend.fetch_daemon_graph" ) . entered ( ) ;
115131 let base_url =
116132 std:: env:: var ( "KIN_DAEMON_URL" ) . unwrap_or_else ( |_| "http://127.0.0.1:4219" . to_string ( ) ) ;
117133
0 commit comments