Skip to content

Commit 1836b4b

Browse files
goffrieConvex, Inc.
authored andcommitted
Add index name to fetch_cache_misses trace properties (#37528)
GitOrigin-RevId: 3e335289036680ed3bb438cb97303a9543a7cc5e
1 parent 102bfe5 commit 1836b4b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

crates/indexing/src/backend_in_memory_indexes.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ use common::{
5252
value::Size,
5353
};
5454
use errors::ErrorMetadata;
55+
use fastrace::local::LocalSpan;
5556
use futures::{
5657
stream,
5758
StreamExt as _,
@@ -586,6 +587,7 @@ impl DatabaseIndexSnapshot {
586587
)> {
587588
let mut results = vec![];
588589
let mut cache_miss_results = vec![];
590+
let mut traced = false;
589591
for cache_result in cache_results {
590592
match cache_result {
591593
DatabaseIndexSnapshotCacheResult::Document(index_key, ts, document) => {
@@ -595,6 +597,12 @@ impl DatabaseIndexSnapshot {
595597
},
596598
DatabaseIndexSnapshotCacheResult::CacheMiss(interval) => {
597599
log_transaction_cache_query(false);
600+
if !traced {
601+
LocalSpan::add_property(|| {
602+
("index", range_request.printable_index_name.to_string())
603+
});
604+
traced = true;
605+
}
598606
// Query persistence.
599607
let mut stream = persistence.index_scan(
600608
index_id,

0 commit comments

Comments
 (0)