-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Reorder processors in publisher pipeline #5149
Conversation
- reorder processors, such that all client processors run before the global processors - remove support for EventsMetadataKey
- combine client internal field updates and configured field updates into one dictionary - combine proessors for adding client and global fields+tags if no client processors are configured
Do not Clone (deep copy) fields being added in the pipeline if no processors are configured. As processors might add/remove fields and potentially modify shared field objects, these must be copied if there is a chance global shared structured being overwritten by processors. Especially if processors are guarded by conditions.
Problem is local fields+tags must be applied after the globaly configured fields and tests, while client processors must be run before the global ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the affect of this order change of processors?
p.processors = tmp | ||
} | ||
|
||
fields := common.MapStr{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to move this to line 391 as it is only used there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. Will simplify fields initialization.
@@ -11,9 +11,8 @@ import ( | |||
// Event metadata constants. These keys are used within libbeat to identify | |||
// metadata stored in an event. | |||
const ( | |||
EventMetadataKey = "_event_metadata" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this already has become obsolete in previous refactoring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The symbol still has been used in the processors pipeline. This PR removes support for _event_metadata
in the pipeline -> can finally remove EventMetadataKey
func makePipelineProcessors( | ||
annotations Annotations, | ||
processors *processors.Processors, | ||
disabled bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter disabled
is not used in this function. Please remove it or use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, thanks. It should be passed to pipelineProcessors
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
In the end it moves the processor adding the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Reorder processors pipeline order - reorder processors, such that all client processors run before the global processors - remove support for EventsMetadataKey * Combine fields and tags if possible - combine client internal field updates and configured field updates into one dictionary - combine proessors for adding client and global fields+tags if no client processors are configured * Do not copy if no processors are defined Do not Clone (deep copy) fields being added in the pipeline if no processors are configured. As processors might add/remove fields and potentially modify shared field objects, these must be copied if there is a chance global shared structured being overwritten by processors. Especially if processors are guarded by conditions. * Fix processors order once again Problem is local fields+tags must be applied after the globaly configured fields and tests, while client processors must be run before the global ones. * review - use 'disabled' flag - simplify pipeline fields init (cherry picked from commit 6082603)
* Reorder processors pipeline order - reorder processors, such that all client processors run before the global processors - remove support for EventsMetadataKey * Combine fields and tags if possible - combine client internal field updates and configured field updates into one dictionary - combine proessors for adding client and global fields+tags if no client processors are configured * Do not copy if no processors are defined Do not Clone (deep copy) fields being added in the pipeline if no processors are configured. As processors might add/remove fields and potentially modify shared field objects, these must be copied if there is a chance global shared structured being overwritten by processors. Especially if processors are guarded by conditions. * Fix processors order once again Problem is local fields+tags must be applied after the globaly configured fields and tests, while client processors must be run before the global ones. * review - use 'disabled' flag - simplify pipeline fields init (cherry picked from commit 6082603)
* Reorder processors pipeline order - reorder processors, such that all client processors run before the global processors - remove support for EventsMetadataKey * Combine fields and tags if possible - combine client internal field updates and configured field updates into one dictionary - combine proessors for adding client and global fields+tags if no client processors are configured * Do not copy if no processors are defined Do not Clone (deep copy) fields being added in the pipeline if no processors are configured. As processors might add/remove fields and potentially modify shared field objects, these must be copied if there is a chance global shared structured being overwritten by processors. Especially if processors are guarded by conditions. * Fix processors order once again Problem is local fields+tags must be applied after the globaly configured fields and tests, while client processors must be run before the global ones. * review - use 'disabled' flag - simplify pipeline fields init (cherry picked from commit b66abfe)
beat
namespace can not be removed from client processors