From 3e075315cf56570a24fa636da06b3a391802805a Mon Sep 17 00:00:00 2001 From: Ertugrul Aypek Date: Mon, 30 Sep 2024 10:17:24 +0200 Subject: [PATCH] use batch span only in sync process --- iris-mpc/src/bin/server.rs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/iris-mpc/src/bin/server.rs b/iris-mpc/src/bin/server.rs index 3de846ca6..10a2d58fd 100644 --- a/iris-mpc/src/bin/server.rs +++ b/iris-mpc/src/bin/server.rs @@ -35,9 +35,8 @@ use iris_mpc_gpu::{ }; use iris_mpc_store::{Store, StoredIrisRef}; use opentelemetry::{ - global::{tracer, ObjectSafeSpan}, - trace::{FutureExt, Link, TraceContextExt, Tracer}, - Context as OtelContext, + global::tracer, + trace::{Link, Span, Tracer}, }; use std::{ collections::HashMap, @@ -904,7 +903,7 @@ async fn server_main(config: Config) -> eyre::Result<()> { let batch = next_batch.await?; // Start a new span for batch processing with the links - let tracer = tracer("iris-mpc"); + let tracer = tracer("mpcv2-batch-tracer"); // Extract the SpanContexts from the individual request spans let links: Vec = batch @@ -918,13 +917,14 @@ async fn server_main(config: Config) -> eyre::Result<()> { links.len() ); - let batch_span = tracer + let mut batch_span = tracer .span_builder("batch_processing") .with_links(links) .start(&tracer); - let otel_context = OtelContext::current_with_span(batch_span); - let otel_context_clone = otel_context.clone(); - let _guard = otel_context.attach(); + batch_span.add_event("Started processing batch", Vec::new()); + // let otel_context = OtelContext::current_with_span(batch_span); + // let otel_context_clone = otel_context.clone(); + // let _guard = otel_context.attach(); process_identity_deletions( &batch, &store, @@ -939,9 +939,7 @@ async fn server_main(config: Config) -> eyre::Result<()> { tracing::info!("Received batch in {:?}", now.elapsed()); background_tasks.check_tasks(); - let result_future = handle - .submit_batch_query(batch) - .with_context(otel_context_clone); + let result_future = handle.submit_batch_query(batch); next_batch = receive_batch( party_id, @@ -990,8 +988,9 @@ async fn process_identity_deletions( dummy_iris_share: &GaloisRingIrisCodeShare, dummy_mask_share: &GaloisRingTrimmedMaskCodeShare, ) -> eyre::Result<()> { - let tracer = tracer("iris-mpc"); + let tracer = tracer("mpcv2-batch-tracer"); let mut span = tracer.start("process_identity_deletions"); + span.add_event("Started processing identity deletions", Vec::new()); if batch.deletion_requests_indices.is_empty() { return Ok(()); }