Skip to content

Commit e23c21b

Browse files
Highlight performance reason to implement event_enabled #3266 (comment)
1 parent dfc718a commit e23c21b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/logs-advanced/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ impl<P: LogProcessor> LogProcessor for SlowEnrichmentLogProcessor<P> {
120120
#[cfg(feature = "spec_unstable_logs_enabled")]
121121
fn event_enabled(&self, level: Severity, target: &str, name: Option<&str>) -> bool {
122122
// It is important to call the delegate's event_enabled method to ensure that
123-
// any filtering or logic implemented by downstream processors is respected.
123+
// any filtering or logic implemented by downstream processors is respected so
124+
// that no unnecessary work is done, causing an unwanted performance issue.
124125
// Skipping this call could result in logs being emitted that should have been filtered out
125126
// or in bypassing other custom logic in the processor chain.
126127
self.delegate.event_enabled(level, target, name)

0 commit comments

Comments
 (0)