-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filter_log_to_metrics: Add timer callback for emitting metrics #9251
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of adding the option to the plugin to keep a metrics context and periodically flush it but I don't think imposing it as the new default behavior is acceptable.
Please restore the original "immediate flush" code and modify your code to select between immediate and delayed flushing (maybe by defaulting the value of timer_interval_ms
to 0
and interpretting 0
as immediate?).
Also, please rename timer_interval_ms
to something more intuitive like flush_interval
and use the FLB_CONFIG_MAP_TIME
type instead (which automatically interprets units and makes it easier for the user).
4d9ee65
to
ccf20e5
Compare
ccf20e5
to
c6d7766
Compare
Hi @leonardo-albertovich! fluent-bit/plugins/filter_multiline/ml.c Line 894 in 8a1d830
Can you please check the changes? Thank you very much! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think with these minimal changes it should be ready to be merged.
I just want to be clear that I'm not familiar with this plugin, my review is based on the code I'm seeing and the intended outcome.
Thanks a lot Doctor!
This commit will change the log_to_metrics filter to use a timer based metric inject and not directly inject metrics on every incoming log record anymore. This will lower the overall load and memory consumption especially in high-volume and high-cardinality situations. Signed-off-by: Richard Treu <[email protected]>
c6d7766
to
b22acf7
Compare
Thank you very much @leonardo-albertovich! |
Docs PR: fluent/fluent-bit-docs#1440 |
(cc: docs @lecaros ) |
This PR will change the log_to_metrics filter to use a timer based metric inject and not directly inject metrics on every incoming log record anymore. This will lower the overall load and memory consumption especially in high-volume and high-cardinality situations.
cc @leonardo-albertovich @edsiper
Fixes #9189
Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
filter_log_to_metrics: Add interval options for metric emission fluent-bit-docs#1440
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.