-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit a counter for when aws s3 and azure blob storage requests are made
- Loading branch information
Showing
5 changed files
with
74 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use metrics::counter; | ||
use vector_lib::internal_event::InternalEvent; | ||
|
||
#[derive(Debug)] | ||
pub struct AwsS3RequestEvent<'a> { | ||
pub bytes_size: usize, | ||
pub events: usize, | ||
pub bucket: &'a str, | ||
pub s3_key: &'a str, | ||
} | ||
|
||
impl InternalEvent for AwsS3RequestEvent<'_> { | ||
fn emit(self) { | ||
debug!( | ||
message = "Sending events.", | ||
bytes = self.bytes_size, | ||
events_len = self.events, | ||
s3_key = self.s3_key, | ||
bucket = self.bucket, | ||
); | ||
counter!("aws_s3_requests_sent_total", 1, | ||
"bucket" => self.bucket.to_string()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use metrics::counter; | ||
use vector_lib::internal_event::InternalEvent; | ||
|
||
#[derive(Debug)] | ||
pub struct AzureBlobRequestEvent<'a> { | ||
pub bytes_size: usize, | ||
pub events: usize, | ||
pub container_name: &'a str, | ||
pub partition_key: &'a str, | ||
} | ||
|
||
impl InternalEvent for AzureBlobRequestEvent<'_> { | ||
fn emit(self) { | ||
debug!( | ||
message = "Sending events.", | ||
bytes = self.bytes_size, | ||
events_len = self.events, | ||
blob = self.partition_key, | ||
container = self.container_name, | ||
); | ||
counter!("azure_blob_requests_sent_total", 1, | ||
"container_name" => self.container_name.to_string()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters