Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chg(sps): log document_id on sync extract enqueue and index completion (#4215)

gbirmand39ef8aa1c83
diff --git a/rust/cloud-storage/search_processing_service/src/api/internal/extract_sync.rs b/rust/cloud-storage/search_processing_service/src/api/internal/extract_sync.rs
index 0698b980f3..599515722c 100644
--- a/rust/cloud-storage/search_processing_service/src/api/internal/extract_sync.rs
+++ b/rust/cloud-storage/search_processing_service/src/api/internal/extract_sync.rs
@@ -53,6 +53,12 @@ pub async fn handler(
State(ctx): State<ApiContext>,
extract::Json(req): extract::Json<ExtractSyncRequest>,
) -> Result<Response, Response> {
+ let document_ids: Vec<&str> = req
+ .documents
+ .iter()
+ .map(|d| d.document_id.as_str())
+ .collect();
+ tracing::info!(?document_ids, "extract_sync received");
let messages: Vec<SearchQueueMessage> = documents_to_messages(req.documents);
ctx.sqs_client
.bulk_send_message_to_search_event_queue(messages)
diff --git a/rust/cloud-storage/search_processing_service/src/process/document/raw_document.rs b/rust/cloud-storage/search_processing_service/src/process/document/raw_document.rs
index 1af49915df..db6102d679 100644
--- a/rust/cloud-storage/search_processing_service/src/process/document/raw_document.rs
+++ b/rust/cloud-storage/search_processing_service/src/process/document/raw_document.rs
@@ -340,7 +340,9 @@ pub async fn update_search_with_sync_document(
let upserts = generate_upserts(document_info, result).context("unable to generate upserts")?;
+ let chunk_count = upserts.len();
upsert_document(opensearch_client, search_extractor_message, upserts).await?;
+ tracing::info!(document_id = %document_id, chunk_count, "sync document indexed");
Ok(())
}