-
Notifications
You must be signed in to change notification settings - Fork 944
AWS Lambda Runtime legacy internal handlers need to be ignored from being instrumented and so traced … #10942
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
Conversation
…eing instrumented and so traced. Otherwise, there might be double root spans.
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.
Wow. Love the deep analysis you went through for this. That seems worthy of a blog post somewhere. Thanks for getting to the bottom of this.
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!
...try/javaagent/instrumentation/awslambdacore/v1_0/AwsLambdaRequestHandlerInstrumentation.java
Show resolved
Hide resolved
…ain/java/io/opentelemetry/javaagent/instrumentation/awslambdacore/v1_0/AwsLambdaRequestHandlerInstrumentation.java Co-authored-by: Trask Stalnaker <[email protected]>
Hi @trask, Thanks for the review, I have applied your suggestion. |
In the [previous bugfix](#1000), we missed porting this change from OTel specifically for Java 8 and 11 runtimes. open-telemetry/opentelemetry-java-instrumentation#10942 **Testing:** Created an ADOT lambda layer with the change and verified that the duplicate lambda spans do not appear for Java 11, 17, and 21. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
... Otherwise, there might be double root spans.
Fixes #10931
In Java 8 and Java 11 runtimes, AWS Lambda runtime is packaged under
lambdainternal
package (it iscom.amazonaws.services.lambda.runtime.api.client
for new runtime likes Java 17 and Java 21)I have
/var/runtime/
folder in the AWS Lambda environment for Java 8 and Java 11 runtimes,Here are the existing files:

Then I have decompiled classes from
LambdaSandboxJava-byol.jar
andLambdaJavaRTEntry-byol.jar
.And as you can see below, AWS Lambda runtime internal classes are packaged under
lambdainternal
package and the internal handler (lambdainternal.EventHandlerLoader
) we need to ignore is there.