vector/internal_events/
file_descriptor.rs

1use metrics::counter;
2use vector_lib::internal_event::{InternalEvent, error_stage, error_type};
3
4#[derive(Debug)]
5pub struct FileDescriptorReadError<E> {
6    pub error: E,
7}
8
9impl<E> InternalEvent for FileDescriptorReadError<E>
10where
11    E: std::fmt::Display,
12{
13    fn emit(self) {
14        error!(
15            message = "Error reading from file descriptor.",
16            error = %self.error,
17            error_type = error_type::CONNECTION_FAILED,
18            stage = error_stage::RECEIVING
19        );
20        counter!(
21            "component_errors_total",
22            "error_type" => error_type::CONNECTION_FAILED,
23            "stage" => error_stage::RECEIVING,
24        )
25        .increment(1);
26    }
27}