-
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
config_format: new config reader with YAML support (#4331) #4621
Merged
Conversation
This file contains 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
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
The following patch introduces a new interface called 'config_format'. This new interface implements a new layer to read and compose a configuration 'context' for Fluent Bit. The idea started on discussion #4331 where initially looking for feedback to extend the format and support 'groups' (or sub section) many needs were expressed like other formats. In the actual implementation which comes from lib/monkey, is not flexible enough and adds complexity when trying to extend it. The new 'config_format' is a 'layer' that generate configuration contexts: +-------------+ +---------------+ +----------------------------+ | Config File | <-- | Config Format | --> | Fluent Bit Readers & Setup | +-------------+ +---------------+ +----------------------------+ The advantage of this is that 'config_format' supports different 'backends' to read data from: this implementation supports 'fluentbit' (current) format but also 'YAML' format. +---------------+ | Config Format | +------+-+------+ | | +------------------+ +-------------+ | fluentbit format | | YAML format | +------------------+ +-------------+ 'fluentbit' format is a backport format from lib/monkey with API changes, the YAML format is parsed by using libyaml when available. The concepts of configuration keeps being the same: - sections: define a block - properties: key/value pairs that belongs to a section The following examples are identical configurations in different formats: --- fluentbit format --- [SERVICE] flush 1 log_level info [INPUT] name tail path /var/log/containers/*.log parser docker [INPUT] name forward listen 0.0.0.0 [OUTPUT] name stdout match * --- eof --- Now the identical representation in YAML: --- YAML format --- service: flush: 1 log_level: info inputs: tail: path: "/var/log/containers/*.log" parser: docker forward: listen: 0.0.0.0 outputs: stdout: match: "*" --- eof --- == Notes == - Fluent Bit config reader is still using the old mechanism, the next patches will migrate to this interface. - 'Groups' are not implemented/supported yet. Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
edsiper
force-pushed
the
config-format
branch
from
January 17, 2022 04:47
2cd630e
to
786c0d7
Compare
Signed-off-by: Eduardo Silva <[email protected]>
15 tasks
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
YAML + Environment vars: https://asciinema.org/a/Zz6ZAS3D6ZJgBtH3rjYwNmzqx note: YAML schema will change a bit now |
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
the following patch makes possible to separate 'visually' only the components of a pipeline. This is useful when having uses that certain inputs must go through certain filters and outputs. This change do not touch routing, it's just a visual separation. --- start of fluent-bit.yaml --- env: flush_interval: 1 service: flush: ${flush_interval} log_level: info http_server: on pipeline: inputs: dummy: samples: 100 tag: example outputs: stdout: match: example pipeline: inputs: tail: path: /var/log/containers/coredns*.log read_from_head: true tag: kube.* filters: kubernetes: match: kube.* outputs: stdout: match: kube.* --- end of file --- Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
@edsiper do we have a docs PR to document the YAML format we're using? |
7 tasks
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.
The following patch introduces a new interface called 'config_format'. This new interface implements a new layer to read and compose a configuration 'context' for Fluent Bit.
The idea started on discussion #4331 where initially looking for feedback to extend the format and support 'groups' (or sub section) many needs were expressed like other formats.
The actual implementation which comes from lib/monkey, is not flexible enough and adds complexity when trying to extend it.
The new 'config_format' is a 'layer' that generate configuration contexts:
The advantage of this is that 'config_format' supports different 'backends' to read data from: this implementation supports 'fluentbit' (current) format but also 'YAML' format.
'fluentbit' format is a backport format from lib/monkey with API changes, the YAML format is parsed by using libyaml when available.
The concepts of configuration keeps being the same:
The following examples are identical configurations in different formats:
--- fluentbit format ---
Now the identical representation in YAML:
another YAML example:
To Do
Migrate library API (internal) to config format (double-check)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.