-
Notifications
You must be signed in to change notification settings - Fork 117
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
Clarify lambda capturing of SQS and SNS message attributes #614
Conversation
… attributes for lambda transaction - If a SNS or SQS single event trigger to an instrumented Lambda function includes message attributes with the name "traceparent" (and "tracestate"), case-insensitive, then those are used to continue the trace. This was already being done for API Gateway event headers. - Also, fix a bug in the capturing of SNS and SQS message attributes as "transaction.context.message.headers". Note that only "String"-type message attributes are captured. Binary-type attributes are base64 encoded. I'm not sure of the value in capturing them. Closes: #1831 Fixes: #2605 Refs: elastic/apm#614
@trentm Great catch! In general: I think it's OK to ignore For Java:
@basepi Let's fix the bug Trent mentioned above for the Python agent as part of the current lambda improvements. |
… attributes for lambda transaction (#2606) - If a SNS or SQS single event trigger to an instrumented Lambda function includes message attributes with the name "traceparent" (and "tracestate"), case-insensitive, then those are used to continue the trace. This was already being done for API Gateway event headers. - Also, fix a bug in the capturing of SNS and SQS message attributes as "transaction.context.message.headers". Note that only "String"-type message attributes are captured. Binary-type attributes are base64 encoded. I'm not sure of the value in capturing them. Closes: #1831 Fixes: #2605 Refs: elastic/apm#614
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.
LGTM from the Java agent perspective as it fits existing implementation.
elastic/apm-agent-nodejs#2605 shows that just setting
transaction.context.message.headers = sqsRecord.messageAttributes
is wrong, becausemessageAttributes
for both SNS and SQS events have a different structure than is expected. Currently the spec just says:This change attempts to clarify that the
messageAttributes
fields in the event cannot be used directly..getValue()
at https://github.com/elastic/apm-agent-java/blob/198cfac574fcbaae2d9a374702637bbcf44c46f8/apm-agent-plugins/apm-awslambda-plugin/src/main/java/co/elastic/apm/agent/awslambda/SNSMessageAttributesGetter.java#L39, for example, is doing with message attributes of type "Binary".Checklist for a small enhancement
CODEOWNERS
)To auto-merge the PR, add
/
schedule YYYY-MM-DD
to the PR description.