-
Notifications
You must be signed in to change notification settings - Fork 207
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
Fix lambda metrics #5201
Fix lambda metrics #5201
Conversation
@@ -30,8 +30,12 @@ public abstract class AbstractSink<T extends Record<?>> implements Sink<T> { | |||
private int waitTimeMs; | |||
private SinkThread sinkThread; | |||
|
|||
protected String getName(final PluginSetting pluginSetting) { |
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 don't think we should change AbstractSink
for renaming. Rather, let the concrete sink pass in the PluginMetrics
. Then handle the renaming in the LambdaSink
directly.
super(pluginSetting, PluginMettrics.fromPluginSetting(pluginSetting));
Signed-off-by: Kondaka <krishkdk@amazon.com>
0d1cbb1
to
482f65c
Compare
Signed-off-by: Kondaka <krishkdk@amazon.com>
Signed-off-by: Kondaka <krishkdk@amazon.com>
@@ -49,6 +49,8 @@ | |||
import software.amazon.awssdk.services.lambda.LambdaAsyncClient; | |||
import software.amazon.awssdk.services.lambda.model.InvokeResponse; | |||
|
|||
import javax.management.RuntimeMBeanException; |
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 unwanted unused import. Please remove it.
if (response.payload() != null) { | ||
responsePayloadMetric.record(response.payload().asByteArray().length); | ||
} | ||
continue; |
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.
Please remove this continue
. It is likely to cause bugs later on.
if (response.payload() != null) { | ||
responsePayloadMetric.record(response.payload().asByteArray().length); | ||
} | ||
continue; |
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.
Please remove this continue
and use the catch to increment. This approach is likely to lead to future code bugs.
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.
Santhosh's next PR is taking care of this - https://github.com/kkondaka/kk-data-prepper-f2/pull/1/files
Description
Fix lambda metrics.
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.