powertools-lambda-java icon indicating copy to clipboard operation
powertools-lambda-java copied to clipboard

RFC: Support for lambda extensions

Open RobertoC27 opened this issue 4 years ago • 3 comments

Is your feature request related to a problem? Please describe. I' currently using lambda extensions for starting an external process and tried to implement powertools' logging and metrics modules into it, however they did not work.

Describe the solution you'd like Powertools recognizing that it is inside lambda environment to emit metrics and format logs.

Describe alternatives you've considered Using cloudwatch sdk and log4j direct implementation, however it involves a lot of plumbing that is not easy to handle.

Additional context Im using java 8 corretto runtime.

RobertoC27 avatar Dec 18 '20 15:12 RobertoC27

Hey, @RobertoC27 Thanks for opening the RFC. We will have to give it some thoughts on what would be the best way to support this but indeed it would be good to have this working inside extensions as well.

pankajagrawal16 avatar Dec 18 '20 17:12 pankajagrawal16

Currently when using this AWS tool within quarkus (2.0.2 with graalv 21.1) you get the following exception:

see why software.amazon.awssdk.core.retry.backoff.FullJitterBackoffStrategy got initialized use --trace-class-initialization=software.amazon.awssdk.core.retry.backoff.FullJitterBackoffStrategy

Which is caused by the fact that initialize the default SqsClient even if you override it later. Could you please do lazy loading of the SqsClient. That way we can fix this problem very easily.

public final class SqsUtils { ///// private static SqsClient client = SqsClient.create();

argenstijn avatar Jul 16 '21 16:07 argenstijn

Currently when using this AWS tool within quarkus (2.0.2 with graalv 21.1) you get the following exception:

see why software.amazon.awssdk.core.retry.backoff.FullJitterBackoffStrategy got initialized use --trace-class-initialization=software.amazon.awssdk.core.retry.backoff.FullJitterBackoffStrategy

Which is caused by the fact that initialize the default SqsClient even if you override it later. Could you please do lazy loading of the SqsClient. That way we can fix this problem very easily.

public final class SqsUtils { ///// private static SqsClient client = SqsClient.create();

Please create a new issue, this isn't associated to the original.

msailes avatar Feb 18 '23 20:02 msailes