forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdnstap.rs
More file actions
25 lines (23 loc) · 742 Bytes
/
dnstap.rs
File metadata and controls
25 lines (23 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use metrics::counter;
use vector_lib::NamedInternalEvent;
use vector_lib::internal_event::{InternalEvent, error_stage, error_type};
#[derive(Debug, NamedInternalEvent)]
pub(crate) struct DnstapParseError<E> {
pub error: E,
}
impl<E: std::fmt::Display> InternalEvent for DnstapParseError<E> {
fn emit(self) {
error!(
message = "Error occurred while parsing dnstap data.",
error = %self.error,
stage = error_stage::PROCESSING,
error_type = error_type::PARSER_FAILED,
);
counter!(
"component_errors_total",
"stage" => error_stage::PROCESSING,
"error_type" => error_type::PARSER_FAILED,
)
.increment(1);
}
}