vector/internal_events/
internal_logs.rs1use metrics::counter;
2use vector_lib::{internal_event::InternalEvent, json_size::JsonSize};
3
4#[derive(Debug)]
5pub struct InternalLogsBytesReceived {
6    pub byte_size: usize,
7}
8
9impl InternalEvent for InternalLogsBytesReceived {
10    fn emit(self) {
11        counter!(
13            "component_received_bytes_total",
14            "protocol" => "internal",
15        )
16        .increment(self.byte_size as u64);
17    }
18}
19
20#[derive(Debug)]
21pub struct InternalLogsEventsReceived {
22    pub byte_size: JsonSize,
23    pub count: usize,
24}
25
26impl InternalEvent for InternalLogsEventsReceived {
27    fn emit(self) {
28        counter!("component_received_events_total").increment(self.count as u64);
30        counter!("component_received_event_bytes_total").increment(self.byte_size.get() as u64);
31    }
32}