-
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
engine: output: Add metrics for displaying the available capacity of chunks as percent #8063
engine: output: Add metrics for displaying the available capacity of chunks as percent #8063
Conversation
…chunks as percent Signed-off-by: Hiroshi Hatake <[email protected]>
Signed-off-by: Hiroshi Hatake <[email protected]>
src/flb_engine.c
Outdated
@@ -207,6 +207,16 @@ static inline int handle_input_event(flb_pipefd_t fd, uint64_t ts, | |||
return 0; | |||
} | |||
|
|||
static inline double calculate_chunk_capacity_percent(struct flb_output_instance *ins) | |||
{ | |||
if (ins->total_limit_size == -1) { |
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.
is there a chance that total_limit_size == 0 ? (if so, it will breaks in the next part of the code)
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.
There is no chance to become total_limit_size == 0 due to these lines fill out -1
value into limit in this case:
https://github.com/fluent/fluent-bit/blob/master/src/flb_output.c#L907-L915
But your suggestion is really reasonable. So, I changed the clause to check zero or lower.
Signed-off-by: Hiroshi Hatake <[email protected]>
@cosmo0920 thank you! |
Currently, the capacity of chunks are not explicitly collected in metrics of fluent bit. This should be collected and described for non fluent-bit expert. Note that the capacity of chunks as percent should be collected per plugins. This is because Fluent Bit can set up different capacity of total limit of chunks per plugin.
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
This newly added metrics should be collected as follows after some of the period of runing:
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
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.