Skip to content

Commit

Permalink
filter_log_to_metrics: add new option discard_logs and code cleanup
Browse files Browse the repository at this point in the history
By default, the filter don't drop the logs from the pipeline, there
are cases where only metrics are desired to reduce log volume.

This patch introduces a new option called discard_logs (default: false)
which when enabled will discard the logs once they are processed.

In addition, other changes were made:

- replacement of flb_malloc() with flb_calloc()
- context structure definition changes: e.g: do not malloc ints
- fix double free on cmetrics context destroy (histograms)
- general cleanups...

NOTE: I noticed that record accessor contexts are being created for fixed
patterns (e.g: $kubernetes['pod_name']), we will need to fix this since
the creation of those contexts are expensive, is times better to have them
in the context and use it on demand.

Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Aug 2, 2024
1 parent 8f0317f commit 3d4ad31
Show file tree
Hide file tree
Showing 2 changed files with 170 additions and 139 deletions.
Loading

0 comments on commit 3d4ad31

Please sign in to comment.