Skip to content

Commit

Permalink
processor_metrics_selector: Implement native processor for metrics ma…
Browse files Browse the repository at this point in the history
…nipulations

* Prevent dangling pointer if cmt context is recreated on input_metric and processor.
* processor_labels: Follow change of the signature of metrics callback
* lib: Support setter for processor to make testing processors easily

Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Mar 14, 2024
1 parent 350c9b5 commit 38b5893
Show file tree
Hide file tree
Showing 10 changed files with 984 additions and 537 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,8 @@ option(FLB_FILTER_GEOIP2 "Enable geoip2 filter"
option(FLB_FILTER_NIGHTFALL "Enable Nightfall filter" Yes)
option(FLB_FILTER_WASM "Enable WASM filter" Yes)
option(FLB_PROCESSOR_LABELS "Enable metrics label manipulation processor" Yes)
option(FLB_PROCESSOR_ATTRIBUTES "Enable atributes manipulation processor" Yes)
option(FLB_PROCESSOR_METRICS_SELECTOR "Enable metrics selector processor" Yes)
option(FLB_PROCESSOR_CONTENT_MODIFIER "Enable content modifier processor" Yes)
option(FLB_PROCESSOR_SELECTOR "Enable selector processor" Yes)


if(DEFINED FLB_NIGHTLY_BUILD AND NOT "${FLB_NIGHTLY_BUILD}" STREQUAL "")
Expand Down
1 change: 1 addition & 0 deletions include/fluent-bit/flb_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <cmetrics/cmt_encode_msgpack.h>
#include <cmetrics/cmt_encode_splunk_hec.h>
#include <cmetrics/cmt_encode_cloudwatch_emf.h>
#include <cmetrics/cmt_filter.h>

/* Metrics IDs for general purpose (used by core and Plugins */
#define FLB_METRIC_N_RECORDS 0
Expand Down
2 changes: 1 addition & 1 deletion plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ REGISTER_IN_PLUGIN("in_random")
# PROCESSORS
# ==========
REGISTER_PROCESSOR_PLUGIN("processor_labels")
REGISTER_PROCESSOR_PLUGIN("processor_metrics_selector")
REGISTER_PROCESSOR_PLUGIN("processor_content_modifier")
REGISTER_PROCESSOR_PLUGIN("processor_selector")

# OUTPUTS
# =======
Expand Down
4 changes: 4 additions & 0 deletions plugins/processor_metrics_selector/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(src
selector.c)

FLB_PLUGIN(processor_metrics_selector "${src}" "")
Loading

0 comments on commit 38b5893

Please sign in to comment.