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