Skip to content
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

chore: Improve processor ordering #12308

Merged
merged 2 commits into from
Nov 30, 2022

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Nov 30, 2022

follow-up on #12113

PR #12113 improved the processor ordering by keeping the loading order within a file. This PR is a follow-up to make the ordering less intrusive, keeping the addProcessor() similar to other add... function and remove the input-file information from the model.

This is achieved by sorting the loaded processors by the line number (similar to #12113) within the loaded file and then add the new chunk to the config's processor array. This way, the loading order of the files is also preserved. To also take the order option into account the processor array is sorted a second time, this time by the order flag using a stable sort. This way all plugins containing an order option are sorted by this value, whereas all other plugins will keep their loading order (across files) and specification order (within each file).

@telegraf-tiger telegraf-tiger bot added the chore label Nov 30, 2022
@telegraf-tiger
Copy link
Contributor

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore plugin/processor ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants