vector/internal_events/
dnstap.rs

1use metrics::counter;
2use vector_lib::NamedInternalEvent;
3use vector_lib::internal_event::{InternalEvent, error_stage, error_type};
4
5#[derive(Debug, NamedInternalEvent)]
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        );
18        counter!(
19            "component_errors_total",
20            "stage" => error_stage::PROCESSING,
21            "error_type" => error_type::PARSER_FAILED,
22        )
23        .increment(1);
24    }
25}