Skip to content

engine: use effective post-processor counts for output metrics (v4.2)#11519

Open
edsiper wants to merge 4 commits into4.2from
4.2-log-counting
Open

engine: use effective post-processor counts for output metrics (v4.2)#11519
edsiper wants to merge 4 commits into4.2from
4.2-log-counting

Conversation

@edsiper
Copy link
Member

@edsiper edsiper commented Mar 3, 2026

This PR fixes output counter parity when processors modify or drop logs.

It introduces route-effective record/byte tracking per task route, stores those effective values at output flush return, and makes engine output/router metrics use those effective counts instead of original task totals. As a result, proc_records, dropped_records, and retry-related counters reflect what was actually processed after output processors.

It also adds a runtime test that validates an output Lua processor dropping records leads to stdout.0 metrics showing proc_records_total=0 and dropped_records_total > 0.


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.

edsiper added 4 commits March 3, 2026 17:34
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@edsiper edsiper requested a review from cosmo0920 as a code owner March 3, 2026 23:37
@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 4.2-log-counting

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@edsiper edsiper changed the title 4.2 log counting engine: use effective post-processor counts for output metrics (v4.2) Mar 3, 2026
@edsiper edsiper added this to the Fluent Bit v4.2.4 milestone Mar 3, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 37aeee63ad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"fluentbit_output_dropped_records_total",
"stdout.0");

if (proc_records == 0.0 && dropped_records > 0.0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove unreachable dropped-record expectation

This check assumes fluentbit_output_dropped_records_total increases when the Lua output processor drops all logs, but that path short-circuits with FLB_OK for zero-record chunks in output_pre_cb_flush (include/fluent-bit/flb_output.h) and handle_output_event only increments dropped counters on FLB_RETRY/FLB_ERROR (src/flb_engine.c). With this test's stdout + drop-all Lua setup, dropped_records_total remains 0, so the condition never becomes true and the test can only timeout/fail.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant