-
Notifications
You must be signed in to change notification settings - Fork 563
docs: administration: monitoring: on-demand-flush: Add on-demand flush to the HTTP server #2642
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
Open
RaJiska
wants to merge
4
commits into
fluent:master
Choose a base branch
from
RaJiska:http-flush-now
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+89
−0
Open
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
25fb041
docs: administration: monitoring: on-demand-flush: Add on-demand flus…
RaJiska 005531f
docs: summary: Add on-demand flush entry
RaJiska c93cc64
docs: summary: Further describe flush_now_count semantics
RaJiska 87100dc
docs: administration: on-demand-flush: Correct response semantics and…
eschabell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| --- | ||
| description: Trigger an immediate flush over HTTP, independent of the periodic Flush interval | ||
| --- | ||
|
|
||
| # On-demand flush | ||
|
|
||
| Fluent Bit supports triggering a flush of currently buffered records on demand, over the HTTP server, independent of the configured periodic `Flush` interval. | ||
|
|
||
| ## Enable the HTTP server | ||
|
|
||
| To get started with on-demand flush over HTTP, enable the HTTP Server in the configuration file: | ||
|
|
||
| {% tabs %} | ||
| {% tab title="fluent-bit.yaml" %} | ||
|
|
||
| ```yaml | ||
| service: | ||
| http_server: on | ||
| http_listen: 0.0.0.0 | ||
| http_port: 2020 | ||
| ``` | ||
|
|
||
| {% endtab %} | ||
| {% tab title="fluent-bit.conf" %} | ||
|
|
||
| ```text | ||
| [SERVICE] | ||
| HTTP_Server On | ||
| HTTP_Listen 0.0.0.0 | ||
| HTTP_PORT 2020 | ||
| ``` | ||
|
|
||
| {% endtab %} | ||
| {% endtabs %} | ||
|
|
||
| ## How to flush | ||
|
|
||
| After enabling the HTTP server, use one of the following methods to trigger an on-demand flush: | ||
|
|
||
| ### HTTP | ||
|
|
||
| Use the following HTTP endpoints to trigger an on-demand flush: | ||
|
|
||
| - `PUT /api/v2/flush` | ||
| - `POST /api/v2/flush` | ||
|
|
||
| For using curl to trigger a flush, users must specify an empty request body as: | ||
|
|
||
| ```shell | ||
| curl -X POST -d '{}' localhost:2020/api/v2/flush | ||
|
eschabell marked this conversation as resolved.
Outdated
|
||
| ``` | ||
|
|
||
| Obtain a count of on-demand flushes using the HTTP endpoint: | ||
|
|
||
| - `GET /api/v2/flush` | ||
|
|
||
| The endpoint returns `flush_now_count` as follows: | ||
|
|
||
| ```json | ||
| {"flush_now_count":3} | ||
| ``` | ||
|
|
||
| The default value of the counter is `0`. | ||
|
|
||
| ## Confirm a flush | ||
|
|
||
| Use the `flush_now_count` returned by the `POST`/`PUT` response, or by a separate `GET /api/v2/flush` call, to confirm that a specific request resulted in a new flush. If the pipeline doesn't acknowledge the flush within the internal timeout, the `POST`/`PUT` endpoint responds with HTTP status `503` instead: | ||
|
|
||
| ```json | ||
| {"flush":"timeout","flush_now_count":0} | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| ``` | ||
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.
Uh oh!
There was an error while loading. Please reload this page.