-
Notifications
You must be signed in to change notification settings - Fork 202
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
ENH: collect plugin config and loading errors during data prepper launch #4816
ENH: collect plugin config and loading errors during data prepper launch #4816
Conversation
Signed-off-by: George Chen <qchea@amazon.com>
Signed-off-by: George Chen <qchea@amazon.com>
Signed-off-by: George Chen <qchea@amazon.com>
Signed-off-by: George Chen <qchea@amazon.com>
final StringBuilder message = new StringBuilder(); | ||
if (pipelineName != null) { | ||
message.append(pipelineName); | ||
message.append(PIPELINE_DELIMITER); |
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.
nit: ERROR_MESSAGE_DELIMITER?
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 is between pipeline and plugin so that is why it is called pipeline DELIMITER.
return pluginFactory.loadPlugin(Source.class, sourceSetting); | ||
} catch (Exception e) { | ||
final PluginError pluginError = PluginError.builder() | ||
.pipelineName(pipelineName) |
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.
Should we include the "componentType?" That is, source
, processor
, sink
, buffer`?
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.
Thanks for the catch! Will add that
final StringBuilder message = new StringBuilder(); | ||
Throwable throwable = exception; | ||
|
||
while (throwable != 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.
We should revisit this in the future. I think ideally, the failure gives a single clear message.
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 agree. Right now some runtime exception does need going down a few layers to get the useful root cause
.stream().filter(pluginError -> pipelineName.equals(pluginError.getPipelineName())) | ||
.collect(Collectors.toList()); | ||
if (!subPipelinePluginErrors.isEmpty()) { | ||
throw new InvalidPluginConfigurationException( |
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.
Where is this caught and handled?
It may make sense to have a single class to take all the errors and consolidate them. Also, multiple pipelines may fail.
And is this the way we want to log it? This will likely create a single long, multi-line log. But, would it be clearer to have multiple log lines?
I'd probably throw an exception that includes a list of PluginError
and then have a single class for handling errors which can then decide how to format and log these.
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.
It is actually caught and handled in L197
I'd probably throw an exception that includes a list of PluginError and then have a single class for handling errors which can then decide how to format and log these.
Agree this part can be further refactored
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.
opened a separate issue to track: #4854
Signed-off-by: George Chen <qchea@amazon.com>
Signed-off-by: George Chen <qchea@amazon.com>
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.
Let's try to get #4854 resolved before we release this in 2.10.
Description
This PR collects all plugin validation and loading errors when launching data prepper. With this change, user can peek a more complete list of plugin errors due to plugin misconfigurations during data prepper launch.
Issues Resolved
Resolves #[Issue number to be closed when this PR is merged]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.