-
Notifications
You must be signed in to change notification settings - Fork 114
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
Support Partial Transaction for AWS Lambda #753
Comments
@lahsivjar would you mind adding some more context? I know we have the draft PR from the go agent but I'm still having a hard time parsing the fine details here. What is a "partial transaction"? Should I compose a barebones transaction dict, with only the I assume we're sending this to the normal I assume I send the metadata blob first as usual? Currently any time we flush our events buffer, the metadata gets sent first. Since the python agent is the only agent that doesn't stream to the APM server this might be an important point for only python -- I don't know how the APM Server would feel about two metadata blobs in a row, assuming you forward the metadata blob but not the partial transaction. It would certainly be easier for my implementation if the extension didn't complain about the second metadata blob when I report the full transaction at the end, but if needed I can modify the transport to exclude it in this specific case. Thanks in advance. |
@basepi The partial transaction flow works like below (there is a pending PR that implements some part of the following based on the received feedback regarding handling
Old (out of date) questions
Based on above, I will try to answer your questions.
I think we should send everything that we can glean at the
The partial transaction should be sent to the
When calling the register endpoint only the encoded partial transaction is expected by the |
@lahsivjar Can you update the above with your changes in elastic/apm-aws-lambda#384 ? Also we should probably update the spec at some point with all of this stuff. |
@basepi I have updated the above message with the new details. Once the PR is finalized I will take a stab at updating the spec. |
I think we should extend that to |
Sounds good to me. In my implementation if it returns anything other than the expected 200, then I log a message and stop using the endpoint. Do you think that is overkill? |
Probably fine. Technically an APM server can return 429 for rate-limited. But (1) I don't think the extension does this and (2) in a back-off scenario it probably makes sense to just stop registering partial transactions anyway. I'll update my implementation to be more broad, right now I'm only doing the explicit 404. |
The initial intention was to ensure backward compatibility of the extension with the agents but by looking at the bigger picture, taking a broader approach to stop registration on any error sounds good. Thanks for raising this @JonasKunz. I will also release the new version of the extension with the latest changes this week. |
Lambda extension |
@lahsivjar do you have the bandwidth to do the spec PR for this? If not I can do it. |
@basepi Thanks for the offer, I am a bit swamped right now and will appreciate the help 🙇 |
Spec is in #799 |
Description
With elastic/apm-aws-lambda#344 the AWS Lambda extension supports registering transactions at the beginning of the transaction/lambda invocation. With that, the extension can finalize the transaction in case that there is an error and the agent fails to report the final transaction.
Implement the ability to send(register) a partial transaction (in sync) to the AWS Lambda extension with the header x-elastic-aws-request-id containing the lambda invocation's request ID. The extension will cache the partial transaction and return a 200 OK response. If the extension returns 404 then the agent should stop sending the registration request for future invocations.
Spec: #799
Agent Issues
The text was updated successfully, but these errors were encountered: