Skip to content

Commit

Permalink
Emit debug, not error from Elasticsearch sink (#423)
Browse files Browse the repository at this point in the history
We have a number of error notifs in the ES sink that are not
really errors. This is now corrected by flipping these things
to debug.

Signed-off-by: Brian L. Troutwine <blt@postmates.com>
  • Loading branch information
blt authored Feb 28, 2018
1 parent ac3d847 commit 68a63bb
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/sink/elasticsearch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,13 @@ impl Sink<ElasticsearchConfig> for Elasticsearch {
ELASTIC_RECORDS_TOTAL_FAILED
.fetch_add(1, Ordering::Relaxed);
if let Some(cause) = item.cause() {
error!(
debug!(
"Failed to write item with error {}, cause {}",
item.description(),
cause
);
} else {
error!(
debug!(
"Failed to write item with error {}",
item.description()
);
Expand Down Expand Up @@ -268,23 +268,23 @@ impl Sink<ElasticsearchConfig> for Elasticsearch {
ApiError::IndexNotFound { ref index } => {
ELASTIC_ERROR_API_INDEX_NOT_FOUND
.fetch_add(1, Ordering::Relaxed);
error!(
debug!(
"Unable to write, API Error (Index Not Found): {}",
index
);
}
ApiError::Parsing { ref reason, .. } => {
ELASTIC_ERROR_API_PARSING
.fetch_add(1, Ordering::Relaxed);
error!(
debug!(
"Unable to write, API Error (Parsing): {}",
reason
);
}
ApiError::MapperParsing { ref reason, .. } => {
ELASTIC_ERROR_API_MAPPER_PARSING
.fetch_add(1, Ordering::Relaxed);
error!(
debug!(
"Unable to write, API Error (Mapper Parsing): {}",
reason
);
Expand All @@ -294,37 +294,37 @@ impl Sink<ElasticsearchConfig> for Elasticsearch {
} => {
ELASTIC_ERROR_API_ACTION_REQUEST_VALIDATION
.fetch_add(1, Ordering::Relaxed);
error!(
debug!(
"Unable to write, API Error (Action Request Validation): {}",
reason
);
}
ApiError::DocumentMissing { ref index, .. } => {
ELASTIC_ERROR_API_DOCUMENT_MISSING
.fetch_add(1, Ordering::Relaxed);
error!(
debug!(
"Unable to write, API Error (Document Missing): {}",
index
);
}
ApiError::IndexAlreadyExists { ref index, .. } => {
ELASTIC_ERROR_API_INDEX_ALREADY_EXISTS
.fetch_add(1, Ordering::Relaxed);
error!(
debug!(
"Unable to write, API Error (Index Already Exists): {}",
index
);
}
_ => {
ELASTIC_ERROR_API_UNKNOWN
.fetch_add(1, Ordering::Relaxed);
error!("Unable to write, API Error (Unknown)");
debug!("Unable to write, API Error (Unknown)");
}
}
}
error::Error::Client(ref client_error) => {
ELASTIC_ERROR_CLIENT.fetch_add(1, Ordering::Relaxed);
error!(
debug!(
"Unable to write, client error: {}",
client_error.description()
);
Expand Down

0 comments on commit 68a63bb

Please sign in to comment.