-
Notifications
You must be signed in to change notification settings - Fork 24.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
Allow pipeline processor to ignore missing pipelines #87354
Allow pipeline processor to ignore missing pipelines #87354
Conversation
Add `ignore_missing_pipeline` option to `pipeline` processor. This controls whether the `pipeline` processor should fail with an error if no pipeline with a name specified in the `name` option exists. This enhancement is useful to setup a pipeline infrastructure that lazily adds extension points for overwrites. So that for specific cluster setups custom pre-processing can be added at a later point in time. Relates to elastic#87323
Pinging @elastic/es-data-management (Team:Data Management) |
Hi @martijnvg, I've created a changelog YAML for you. |
Pinging @elastic/clients-team (Team:Clients) |
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 from a Fleet perspective. I tested this with different combinations of these pipelines dev tools commands and everything worked as expected:
PUT _ingest/pipeline/test-pipeline
{
"processors": [
{
"append": {
"field": "hello",
"value": "from test-pipeline"
}
},
{
"pipeline": {
"name": "test-custom",
"ignore_missing_pipeline": true
}
}
]
}
PUT _ingest/pipeline/test-custom
{
"processors": [
{
"append": {
"field": "hello",
"value": "from test-custom"
}
},
{
"fail": {
"message": "boom!"
}
}
]
}
DELETE _ingest/pipeline/test-custom
POST _ingest/pipeline/test-pipeline/_simulate
{
"docs": [
{ "_index": "x", "_source": { "foo": "bar" } }
]
}
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, thanks for adding this Martijn!
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.
Great idea.
@@ -33,10 +41,14 @@ public void execute(IngestDocument ingestDocument, BiConsumer<IngestDocument, Ex | |||
if (pipeline != null) { |
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.
From a performance aspect the getPipeline()
operation is basically a regular Map
lookup, right?
This path will get executed a lot if this feature is used in all Fleet data stream pipelines. I just wanted to confirm that lookup failures are not particularly expensive 😄 (like lazy loading on lookup failure).
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.
From a performance aspect the getPipeline() operation is basically a regular Map lookup, right?
Yes, this method performs a map lookup. I don't think this map lookup will be noticeable during indexing (many other operations occur during indexing, so I don't think this will be visible).
Add
ignore_missing_pipeline
option topipeline
processor.This controls whether the
pipeline
processor should failwith an error if no pipeline with a name specified in the
name
option exists.This enhancement is useful to setup a pipeline infrastructure
that lazily adds extension points for overwrites. So that
for specific cluster setups custom pre-processing can be added
at a later point in time.
Relates to #87323