vector/internal_events/
aws.rs

1use metrics::counter;
2use vector_lib::internal_event::InternalEvent;
3
4pub struct AwsBytesSent {
5    pub byte_size: usize,
6    pub region: Option<aws_types::region::Region>,
7}
8
9impl InternalEvent for AwsBytesSent {
10    fn emit(self) {
11        let region = self
12            .region
13            .as_ref()
14            .map_or(String::new(), |r| r.as_ref().to_string());
15        trace!(
16            message = "Bytes sent.",
17            protocol = "https",
18            byte_size = %self.byte_size,
19            region = ?self.region,
20        );
21        counter!(
22            "component_sent_bytes_total",
23            "protocol" => "https",
24            "region" => region,
25        )
26        .increment(self.byte_size as u64);
27    }
28}