-
Notifications
You must be signed in to change notification settings - Fork 306
Description
Area(s)
area:faas
What's missing?
The FAAS (or AWS Lambda specifically) spec for SQS messaging seems to be somewhat deviating from what the general messaging spec prescribes. The latter one changed quite a while ago, doing away with separate process spans per message processed. See: https://github.com/open-telemetry/semantic-conventions/pull/284/changes
In the FAAS spec however, the use of processing spans is still being prescribed today: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/faas/aws-lambda.md?plain=1#L161-L162
For each message, an additional span SHOULD be created to correspond with the handling of the SQS message.
I see no reason to keep separate processing spans only for FAAS contexts. And think it would be beneficial to align this with the general spec, since I think it's more straightforward if the behaviour is roughly the same.
Messaging triggers for aws lambda aren't widely supported yet by most language-specific aws-lambda instrumentation libs, and this specific "limitation" of needing to create process spans became clear when working on an implementation for javascript: open-telemetry/opentelemetry-js-contrib#2981 (comment)
Describe the solution you'd like
There's one important thing to keep into account, which is that when working with sqs and aws lambda functions you will have an event source mapping inbetween. So the lambda function is not doing a receive operation, since it isn't polling sqs for messages itself.
What makes most sense to me is to keep what is already described in the spec at: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/faas/aws-lambda.md?plain=1#L169-L183
But I don't see any value in keeping the per message processing span. Or at least I believe the wording should be changed to say:
For each message, an additional span
SHOULDCAN be created to correspond with the handling of the SQS message.
Other than that it still makes sense to me to have the lambda invocation span as parent and then a separate span to represent the entire batch of messages being processed, having a span link for each message in that batch.
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Metadata
Metadata
Assignees
Type
Projects
Status