vector/internal_events/
dnstap.rs

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