Skip to content

Commit dc2ab59

Browse files
committed
processor: add log_sampling processor for rate limiting
Add new processor for log sampling with three window strategies: - Fixed window: samples first N logs per time window - Sliding window: maintains rolling rate limit - Exponential decay: reduces sampling rate over time Signed-off-by: Jorge Niedbalski <[email protected]>
1 parent 51f21f3 commit dc2ab59

File tree

7 files changed

+721
-0
lines changed

7 files changed

+721
-0
lines changed

cmake/plugins_options.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ DEFINE_OPTION(FLB_IN_EBPF "Enable Linux eBPF input plugin"
7070
# ==========
7171
DEFINE_OPTION(FLB_PROCESSOR_CONTENT_MODIFIER "Enable content modifier processor" ON)
7272
DEFINE_OPTION(FLB_PROCESSOR_LABELS "Enable metrics label manipulation processor" ON)
73+
DEFINE_OPTION(FLB_PROCESSOR_LOG_SAMPLING "Enable log sampling processor" ON)
7374
DEFINE_OPTION(FLB_PROCESSOR_METRICS_SELECTOR "Enable metrics selector processor" ON)
7475
DEFINE_OPTION(FLB_PROCESSOR_OPENTELEMETRY_ENVELOPE "Enable OpenTelemetry envelope processor" ON)
7576
DEFINE_OPTION(FLB_PROCESSOR_SQL "Enable SQL processor" ON)

plugins/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ REGISTER_IN_PLUGIN("in_random")
345345
# ==========
346346
REGISTER_PROCESSOR_PLUGIN("processor_content_modifier")
347347
REGISTER_PROCESSOR_PLUGIN("processor_labels")
348+
REGISTER_PROCESSOR_PLUGIN("processor_log_sampling")
348349
REGISTER_PROCESSOR_PLUGIN("processor_metrics_selector")
349350
REGISTER_PROCESSOR_PLUGIN("processor_opentelemetry_envelope")
350351
REGISTER_PROCESSOR_PLUGIN("processor_sampling")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FLB_PLUGIN(processor_log_sampling "log_sampling.c" "")

0 commit comments

Comments
 (0)