forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaws.rs
More file actions
30 lines (28 loc) · 792 Bytes
/
aws.rs
File metadata and controls
30 lines (28 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use metrics::counter;
use vector_lib::NamedInternalEvent;
use vector_lib::internal_event::InternalEvent;
#[derive(NamedInternalEvent)]
pub struct AwsBytesSent {
pub byte_size: usize,
pub region: Option<aws_types::region::Region>,
}
impl InternalEvent for AwsBytesSent {
fn emit(self) {
let region = self
.region
.as_ref()
.map_or(String::new(), |r| r.as_ref().to_string());
trace!(
message = "Bytes sent.",
protocol = "https",
byte_size = %self.byte_size,
region = ?self.region,
);
counter!(
"component_sent_bytes_total",
"protocol" => "https",
"region" => region,
)
.increment(self.byte_size as u64);
}
}