-
Notifications
You must be signed in to change notification settings - Fork 1.8k
routing: add new routing mechanism for input plugins #11041
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4739f90
config_format: add new function to add property variant
edsiper 47d5af6
config_format: yaml: add support for input routes and outputs
edsiper cb99625
router_config: new interface to parse new input routing logic
edsiper 5cc028b
router_condition: add new conditional template interface
edsiper 9120a11
router: check for new input routes
edsiper 1ce25b9
config: add list for input routes
edsiper e3cbd4d
build: register new router interface files
edsiper c9f3d04
tests: internal: routing: add new unit tests
edsiper e163e5a
tests: internal: routing: add precedense check
edsiper 65fc716
config_format: yaml: fix processors recognition
edsiper b370171
router_config: allow not having routes (optional)
edsiper 228ae7a
router_config: fix signal compatibility check logic
edsiper 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
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
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 |
---|---|---|
|
@@ -44,6 +44,7 @@ | |
#include <fluent-bit/flb_config_format.h> | ||
#include <fluent-bit/multiline/flb_ml.h> | ||
#include <fluent-bit/flb_bucket_queue.h> | ||
#include <fluent-bit/flb_router.h> | ||
|
||
const char *FLB_CONF_ENV_LOGLEVEL = "FLB_LOG_LEVEL"; | ||
|
||
|
@@ -367,6 +368,7 @@ struct flb_config *flb_config_init() | |
mk_list_init(&config->filters); | ||
mk_list_init(&config->outputs); | ||
mk_list_init(&config->proxies); | ||
cfl_list_init(&config->input_routes); | ||
mk_list_init(&config->workers); | ||
mk_list_init(&config->upstreams); | ||
mk_list_init(&config->downstreams); | ||
|
@@ -613,6 +615,9 @@ void flb_config_exit(struct flb_config *config) | |
flb_config_task_map_resize(config, 0); | ||
flb_routes_empty_mask_destroy(config); | ||
|
||
/* Clean up router input routes */ | ||
flb_router_routes_destroy(&config->input_routes); | ||
|
||
flb_free(config); | ||
} | ||
|
||
|
@@ -856,6 +861,9 @@ static int configure_plugins_type(struct flb_config *config, struct flb_cf *cf, | |
if (strcasecmp(kv->key, "name") == 0) { | ||
continue; | ||
} | ||
if (strcasecmp(kv->key, "routes") == 0) { | ||
continue; | ||
} | ||
|
||
Comment on lines
+864
to
867
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not process “processors” as a regular property Guard against variant “processors” breaking plugin setup; skip it like “routes”, or handle the variant explicitly. if (strcasecmp(kv->key, "name") == 0) {
continue;
}
if (strcasecmp(kv->key, "routes") == 0) {
continue;
}
+ if (strcasecmp(kv->key, "processors") == 0) {
+ /* handled via group loader or (future) variant loader */
+ continue;
+ } 🤖 Prompt for AI Agents
|
||
/* set ret to -1 to ensure that we treat any unhandled plugin or | ||
* value types as errors. | ||
|
@@ -960,6 +968,7 @@ static int configure_plugins_type(struct flb_config *config, struct flb_cf *cf, | |
int flb_config_load_config_format(struct flb_config *config, struct flb_cf *cf) | ||
{ | ||
int ret; | ||
flb_debug("[config] starting configuration loading"); | ||
struct flb_kv *kv; | ||
struct mk_list *head; | ||
struct cfl_kvpair *ckv; | ||
|
@@ -1061,6 +1070,13 @@ int flb_config_load_config_format(struct flb_config *config, struct flb_cf *cf) | |
return -1; | ||
} | ||
|
||
/* Parse new router configuration */ | ||
ret = flb_router_config_parse(cf, &config->input_routes, config); | ||
if (ret == -1) { | ||
flb_debug("[router] router configuration parsing failed"); | ||
return -1; | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
|
Oops, something went wrong.
Oops, something went wrong.
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.