Skip to content

Commit

Permalink
Small log improvement.
Browse files Browse the repository at this point in the history
  • Loading branch information
fmassot committed Dec 26, 2023
1 parent 513d57e commit d8ae001
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions quickwit/quickwit-indexing/src/actors/doc_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use std::string::FromUtf8Error;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;

use thiserror::Error;
use anyhow::{bail, Context};
use async_trait::async_trait;
use bytes::Bytes;
Expand Down Expand Up @@ -79,12 +80,16 @@ impl JsonDoc {
}
}

#[derive(Debug)]
#[derive(Error, Debug)]
pub enum DocProcessorError {
#[error("doc mapper parsing error: {0}")]
DocMapperParsing(DocParsingError),
#[error("OLTP trace parsing error: {0}")]
OltpTraceParsing(OtlpTraceError),
#[error("doc parsing error: {0}")]
Parsing(String),
#[cfg(feature = "vrl")]
#[error("VRL transform error: {0}")]
Transform(VrlTerminate),
}

Expand Down Expand Up @@ -309,7 +314,7 @@ impl DocProcessorCounters {
}
DocProcessorError::Parsing(_) => {
self.num_doc_parsing_errors.fetch_add(1, Ordering::Relaxed);
"json_parsing_error"
"parsing_error"
}
#[cfg(feature = "vrl")]
DocProcessorError::Transform(_) => {
Expand Down Expand Up @@ -408,7 +413,7 @@ impl DocProcessor {
processed_docs.push(processed_doc);
}
Err(error) => {
warn!(index_id=self.counters.index_id, source_id=self.counters.source_id, error=?error);
warn!(index_id=self.counters.index_id, source_id=self.counters.source_id, "{}", error);
self.counters.record_error(error, num_bytes as u64);
}
}
Expand Down

0 comments on commit d8ae001

Please sign in to comment.