-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add kubernetes logs source implementation
Signed-off-by: MOZGIII <mike-n@narod.ru>
- Loading branch information
Showing
4 changed files
with
270 additions
and
3 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
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,31 @@ | ||
use super::InternalEvent; | ||
use metrics::counter; | ||
|
||
#[derive(Debug)] | ||
pub struct KubernetesLogsEventReceived<'a> { | ||
pub file: &'a str, | ||
pub byte_size: usize, | ||
} | ||
|
||
impl InternalEvent for KubernetesLogsEventReceived<'_> { | ||
fn emit_logs(&self) { | ||
trace!( | ||
message = "received one event.", | ||
%self.file, | ||
rate_limit_secs = 10 | ||
); | ||
} | ||
|
||
fn emit_metrics(&self) { | ||
counter!( | ||
"events_processed", 1, | ||
"component_kind" => "source", | ||
"component_type" => "kubernetes_logs", | ||
); | ||
counter!( | ||
"bytes_processed", self.byte_size as u64, | ||
"component_kind" => "source", | ||
"component_type" => "kubernetes_logs", | ||
); | ||
} | ||
} |
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