formatting

This commit is contained in:
OlivierDehaene 2023-02-10 15:35:01 +01:00
parent 67cd625c82
commit 26c7bdeab2
3 changed files with 7 additions and 7 deletions

View File

@ -244,10 +244,12 @@ async fn batching_task(
} }
// Create span for this batch to add context to inference calls // Create span for this batch to add context to inference calls
let next_batch_size = entries.len(); let next_batch_size = entries.len();
let next_batch_span = info_span!(parent: None, "batch", batch_size = next_batch_size); let next_batch_span =
info_span!(parent: None, "batch", batch_size = next_batch_size);
entries.iter_mut().for_each(|(_, entry)| { entries.iter_mut().for_each(|(_, entry)| {
// Create a new span to link the batch back to this entry // Create a new span to link the batch back to this entry
let entry_batch_span = info_span!(parent: &entry.span, "infer", batch_size = next_batch_size); let entry_batch_span =
info_span!(parent: &entry.span, "infer", batch_size = next_batch_size);
// Add relationship // Add relationship
entry_batch_span.follows_from(&next_batch_span); entry_batch_span.follows_from(&next_batch_span);
// Update entry // Update entry

View File

@ -118,10 +118,7 @@ fn init_logging(otlp_endpoint: Option<String>, json_output: bool) {
.with_line_number(true); .with_line_number(true);
let fmt_layer = match json_output { let fmt_layer = match json_output {
true => fmt_layer true => fmt_layer.json().flatten_event(true).boxed(),
.json()
.flatten_event(true)
.boxed(),
false => fmt_layer.boxed(), false => fmt_layer.boxed(),
}; };
layers.push(fmt_layer); layers.push(fmt_layer);

View File

@ -158,7 +158,8 @@ impl State {
.drain(..next_batch_size) .drain(..next_batch_size)
.for_each(|(id, mut entry)| { .for_each(|(id, mut entry)| {
// Create a new span to link the batch back to this entry // Create a new span to link the batch back to this entry
let entry_batch_span = info_span!(parent: &entry.span, "infer", batch_size = next_batch_size); let entry_batch_span =
info_span!(parent: &entry.span, "infer", batch_size = next_batch_size);
// Add relationship // Add relationship
entry_batch_span.follows_from(&next_batch_span); entry_batch_span.follows_from(&next_batch_span);
// Update entry // Update entry