out_prometheus_exporter: run flushes on an output worker#12112
Draft
stondo wants to merge 4 commits into
Draft
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Propagate buffer_chunk_size and workers from the parsed HTTP server configuration when creating the exporter HTTP server. Signed-off-by: Stefano Tondo <stondo@gmail.com>
Verify that the configured buffer chunk size and worker count reach the embedded HTTP server and create a worker runtime. Signed-off-by: Stefano Tondo <stondo@gmail.com>
Use one output worker by default so metrics decoding and Prometheus text encoding do not block the main engine event loop. Signed-off-by: Stefano Tondo <stondo@gmail.com>
Verify that the Prometheus exporter default creates and starts a single output worker thread pool. Signed-off-by: Stefano Tondo <stondo@gmail.com>
stondo
force-pushed
the
enhancement/out-prometheus-exporter-output-worker
branch
from
July 19, 2026 20:53
62ca560 to
5b79740
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dependency
This draft is intentionally stacked on the HTTP-option correctness PR. It will be
rebased onto current
masterafter that PR merges.Depends on #12111
Summary
Run
out_prometheus_exporter::cb_prom_flush()on one output worker by default ratherthan on the main engine event loop.
The callback synchronously decodes the metrics chunk and encodes the Prometheus text
payload. Large process-metrics payloads can therefore occupy the main event loop long
enough to delay unrelated request handling.
Change
The runtime test additionally verifies:
Why one worker
out_vivo_exporter, the other HTTP-serving output, already uses one workerTrade-off
Each Prometheus exporter instance gains one thread and its associated runtime
resources. The change does not reduce encoding CPU time; it changes where that work is
scheduled.
Configuration consideration
For outputs carrying
FLB_OUTPUT_HTTP_SERVER, the bareworkerscompatibility aliasis parsed as an HTTP server setting before generic output-worker handling. The new
one-worker plugin default therefore is not currently overridden through that bare
property;
http_server.workerscontinues to control HTTP listener workers.This matches the existing
out_vivo_exporterdefault. Maintainer feedback is welcomeon whether output-worker configurability for HTTP-serving outputs should be addressed
as a separate shared configuration change.
Performance evidence
Repeated current-master A/B tests used approximately 1500 processes and 5.4-5.5 MB
payloads:
An earlier run showed the same direction: 158 ms and 11 requests over 100 ms versus
16 ms and none.
Testing
Commands:
These ran in the documented Debian 12 rootless Podman environment. The explicit AVX2
flag is a GCC 12 compatibility workaround for bundled
simdutf, not part of thischange.
Results:
Enter
[N/A]in the box, if an item is not applicable to your change.Testing
Packaging
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.