-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Enhance the ingest node simulate verbose output #60433
Conversation
For ingest node processors a per processor description was recently added. This commit displays that description in the verbose output of the pipeline simulation. related elastic#57906
- match: { docs.0.processor_results.0.doc._source.field1: "123.42 400 <foo>" } | ||
- match: { docs.0.processor_results.0.doc._source.status: 200 } | ||
- length: { docs.0.processor_results.1: 2 } | ||
- length: { docs.0.processor_results.1: 4 } |
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.
because we now always return status
and processor_type
@@ -731,16 +741,25 @@ teardown: | |||
] | |||
} | |||
- length: { docs: 1 } | |||
- length: { docs.0.processor_results: 3 } | |||
- length: { docs.0.processor_results: 5 } |
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.
because we now show the pipeline processor in the results
} | ||
handler.accept(null, elasticsearchException); | ||
} | ||
} else { | ||
//now that we know that there are no cycles between pipelines, decorate the processors for this pipeline and execute it | ||
CompoundProcessor verbosePipelineProcessor = decorate(pipeline.getCompoundProcessor(), null, processorResultList); | ||
//add the pipeline process to the results | ||
processorResultList.add(new SimulateProcessorResult(actualProcessor.getType(), actualProcessor.getTag(), | ||
actualProcessor.getDescription(), conditionalWithResult)); |
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 think we never added the pipeline processor in the past because there would have been nothing to display, but now that we always show the type (pipeline) and status (i.e. success) there is something to display, so this line is what adds this to the output. The addition of this output caused a few tests to need to be updated
Pinging @elastic/es-core-features (:Core/Features/Ingest) |
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.
Just one question, but otherwise LGTM
@@ -35,6 +36,7 @@ | |||
private final ConditionalProcessor conditionalProcessor; | |||
private final List<SimulateProcessorResult> processorResultList; | |||
private final boolean ignoreFailure; | |||
private Tuple<String, Boolean> conditionalWithResult = null; //null = no conditional |
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.
Seems like this could be a local variable in the execute function?
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.
This commit enhances the verbose output for the `_ingest/pipeline/_simulate?verbose` api. Specifically this adds the following: * the pipeline processor is now included in the output * the conditional (if) and result is now included in the output iff it was defined * a status field is always displayed. the possible values of status are * `success` - if the processor ran with out errors * `error` - if the processor ran but threw an error that was not ingored * `error_ignored` - if the processor ran but threw an error that was ingored * `skipped` - if the process did not run (currently only possible if the if condition evaluates to false) * `dropped` - if the the `drop` processor ran and dropped the document * a `processor_type` field for the type of processor (e.g. set, rename, etc.) * throw a better error if trying to simulate with a pipeline that does not exist closes elastic#56004 # Conflicts: # docs/reference/ingest/apis/simulate-pipeline.asciidoc
This commit enhances the verbose output for the `_ingest/pipeline/_simulate?verbose` api. Specifically this adds the following: * the pipeline processor is now included in the output * the conditional (if) and result is now included in the output iff it was defined * a status field is always displayed. the possible values of status are * `success` - if the processor ran with out errors * `error` - if the processor ran but threw an error that was not ingored * `error_ignored` - if the processor ran but threw an error that was ingored * `skipped` - if the process did not run (currently only possible if the if condition evaluates to false) * `dropped` - if the the `drop` processor ran and dropped the document * a `processor_type` field for the type of processor (e.g. set, rename, etc.) * throw a better error if trying to simulate with a pipeline that does not exist closes #56004
This commit enhances the verbose output for the
_ingest/pipeline/_simulate?verbose
api. Specificallythis adds the following:
success
- if the processor ran with out errorserror
- if the processor ran but threw an error that was not ingorederror_ignored
- if the processor ran but threw an error that was ingoredskipped
- if the process did not run (currently only possible if the if condition evaluates to false)dropped
- if the thedrop
processor ran and dropped the documentprocessor_type
field for the type of processor (e.g. set, rename, etc.)closes #56004
===========
Example input:
Example output: