-
Notifications
You must be signed in to change notification settings - Fork 176
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
Java wrapper swallows S3 event data #640
Java wrapper swallows S3 event data #640
Comments
Is there any alternate workaround for this until this bug get fixed and released. ? |
I have the same issue, i see the lambda is triggered when an object is inserted into s3 bucket, but there are no records in the s3Event. Is there any alternative? |
I have the same issue as well... When I remove the wrapper ( |
Was able to replicate the issue for Java 11 runtime, however this issue is not present with Java 17 runtime. |
Bumping the thread so that I can be assigned to this issue. |
@janfreymann @Kausik-A @Aneurysm9 The reason is that deserialization of S3 event needs custom logic and therefore AWS Lambda runtime has its own specific deserializer for the S3 event: https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-serialization/src/main/java/com/amazonaws/services/lambda/runtime/serialization/events/serializers/S3EventSerializer.java IMO, for a proper solution to this issue, If no one is working on this, I am happy to take this issue. Or can help the one who is already working on this. |
Any update for this? I'm having the same issue right now, is the only solution to completely remove the otel layer? |
I think @serkan-ozal got the issue sorted out, specially based on comment comment in this code https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-serialization/src/main/java/com/amazonaws/services/lambda/runtime/serialization/events/serializers/S3EventSerializer.java#L22 @serkan-ozal do you still want to work on this? sorry for the late response. If not, I will take a look. |
I wonder if we really need to add |
Hi @rapphil, Yes, I can work on this if you have not started working yet. About the adding |
@rapphil, As far as I have checked, it is not available in the AWS Lambda runtime environment. Here are the available ones: So, seems that, we need to include |
I believe the code from the serialization library is available by default in the runtime of the lambda. The same runtime code is responsible by calling the lambda handler. If you follow through this https://github.com/aws/aws-lambda-java-libs/blob/258b00a546631a9b91cbb1b8c126c7c00a88354c/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/AWSLambda.java you are going to see how handlers are invoked and how the events are serialized and etc. This code is the one that is used for the case that you want to build a lambda from a container image. For the case of regular lambdas, I think it will be in the classpath by default. I have run a small experiment that poke into a class that is present in the
Then I got as output in cw logs:
I think we can try to run a small experiment to check if it is possible to use the serializers from |
Hmm, that is interesting. I think, I got the jar files from Java 8 runtime so |
I have verified that However, So, seems that we don't need to put Additionally, not sure we are supporting |
Nice findings!!! we do currently support java8, but I wonder if should continue given that no new functions can be created with java8. I think we can remove support to the java8 runtime in the next release anyways since it is deprecated and there is an alternative to use java8.al2, which should work for the majority of the cases: https://aws.amazon.com/blogs/compute/announcing-migration-of-the-java-8-runtime-in-aws-lambda-to-amazon-corretto/ |
@rapphil If no one is currently working on this, I can take this one. If so, could you assign this to me? |
@rapphil @tylerbenson Have just sent this PR: open-telemetry/opentelemetry-java-instrumentation#11868 |
Describe the bug
We use the Java wrapper with opentelemetry-lambda-layer.zip and the
opt/otel-handler
. The lambda is triggered via AWS event bridge whenever a new object is created in an S3 bucket. The event is processed via a Java class implementingRequestHandler<S3Event, String>
.When we add the opentelemetry layer, the event is gone, i.e. cannot be parsed.
Steps to reproduce
RequestHandler<S3Event, String>
opt/otel-handler
What did you expect to see?
The S3 event should be visible to the Lambda's RequestHandler, there should be at least one record inside the S3 event.
What did you see instead?
The event was present, but did not contain any records.
What version of collector/language SDK version did you use?
opentelemetry-lambda
:a2fa39178...
com.amazonaws:aws-lambda-java-core:1.2.2.
com.amazonaw:aws-lambda-java-events:3.11.0
What language layer did you use?
Java
The text was updated successfully, but these errors were encountered: