-
Notifications
You must be signed in to change notification settings - Fork 293
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
Ensure lambda instrumentation only notifies extension once. #5422
Conversation
BenchmarksParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 22 cases. |
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.
Looks good.
The codenarc failure seems to be an unnecessary import in the test 🤷🏼♂️
import java.util.Set; | ||
import okio.BufferedSink; | ||
|
||
public final class ReadFromInputStreamJsonAdapter<T> extends JsonAdapter<T> { |
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.
Can't T
be ByteArrayInputStream
since you know the type?
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.
good point. updated.
1791176
to
16b48e1
Compare
16b48e1
to
f088030
Compare
What Does This Do
Prevent calling
start-invocation
andend-invocation
on the aws lambda extension multiple times.The lambda event needs to be serialized to json and shared with the extension. This event was properly serialized for the second wrapping, but not for the first. This means that once the extra handler wrapping is ignored, only one
aws.lambda
span is being created, but the lack of event json means we won't be able to create inferred spans or properly handle trace context.The solution for this second problem is to add a new json adapter to serialize these types.
Motivation
In the most recent version of the java tracing layer for aws lambda, the request handler is being wrapped at least twice.
This double wrapping is causing the tracer to make calls to
start-invocation
andend-invocation
multiple times. Aaws.lambda
root span is created in the extension for every call to these endpoints.Additional Notes