vector/internal_events/
dnstap.rs1use metrics::counter;
2use vector_lib::internal_event::InternalEvent;
3use vector_lib::internal_event::{error_stage, error_type};
4
5#[derive(Debug)]
6pub(crate) struct DnstapParseError<E> {
7 pub error: E,
8}
9
10impl<E: std::fmt::Display> InternalEvent for DnstapParseError<E> {
11 fn emit(self) {
12 error!(
13 message = "Error occurred while parsing dnstap data.",
14 error = %self.error,
15 stage = error_stage::PROCESSING,
16 error_type = error_type::PARSER_FAILED,
17 internal_log_rate_limit = true,
18 );
19 counter!(
20 "component_errors_total",
21 "stage" => error_stage::PROCESSING,
22 "error_type" => error_type::PARSER_FAILED,
23 )
24 .increment(1);
25 }
26}