-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhancement(dedupe transform): add internal events (#3809)
Closes #3393 Signed-off-by: Luke Steensen <[email protected]> Co-authored-by: Jean Mertz <[email protected]>
- Loading branch information
1 parent
54a4d8e
commit ff555aa
Showing
3 changed files
with
43 additions
and
5 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,36 @@ | ||
use super::InternalEvent; | ||
use metrics::counter; | ||
|
||
#[derive(Debug)] | ||
pub(crate) struct DedupeEventProcessed; | ||
|
||
impl InternalEvent for DedupeEventProcessed { | ||
fn emit_metrics(&self) { | ||
counter!("events_processed", 1, | ||
"component_kind" => "transform", | ||
"component_type" => "dedupe", | ||
); | ||
} | ||
} | ||
|
||
#[derive(Debug)] | ||
pub(crate) struct DedupeEventDiscarded { | ||
pub event: crate::Event, | ||
} | ||
|
||
impl InternalEvent for DedupeEventDiscarded { | ||
fn emit_logs(&self) { | ||
warn!( | ||
message = "Encountered duplicate event; discarding.", | ||
rate_limit_secs = 30 | ||
); | ||
trace!(message = "Encountered duplicate event; discarding.", event = ?self.event); | ||
} | ||
|
||
fn emit_metrics(&self) { | ||
counter!("duplicate_events_discarded", 1, | ||
"component_kind" => "transform", | ||
"component_type" => "dedupe", | ||
); | ||
} | ||
} |
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