-
Notifications
You must be signed in to change notification settings - Fork 860
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
aws-sdk SQS propagation #5167
Comments
Hi @blumamir - currently the spec is only in the context of Lambda, but the concept is similar to any handling of an SQS message I think.
IIRC, this only happens when API gateway is involved as it is actually the one creating a trace in that issue. When disabled, it should otherwise be an invalid context with the value "Sampled=0" and no IDs. But there are some bugs in API gateway that cause problems unfortunately :(
For reference, there is current work on supporting baggage and w3c headers within AWS services, though it will take a while to make it to existing services like SQS. The biggest problem with avoiding To work around the API gateway bug and baggage support, adding a setting here to opt-in to OTel propagation would be OK. But if your use case doesn't actually involve these, then actually it will be better served by having the other languages have an option, which should be the default similar to the spec for Lambda (we should probably update the spec to move that section to the AWS SDK instrumentation spec to indicate it's not only for Lambda). This is the only way to ensure the stablest propagation across various AWS services, S3 event bridge appsync right now, in the future we hope to have more middle-node services covered too. Let me know if anything's not clear. |
Updating here that I am working on adding an option to use the otel propagators via message attributes in SQS, to support context propagation between nodejs / ruby <-> java. |
I have also encountered the problem with propagating baggage via sns/sqs. I also put baggage into message attributes, only manually. Having this implemented in the instrumentation side would be great. |
I started working on it back ago but it needs a refactor greater than I planned. I don't remember all the details, but I think the instrumentation uses some mechanism only to handle span at request time and response time, where the injection needs to happen after span creation (so we have the span id to inject) but before the request is sent on the wire (so it can include the message attributes). |
You're right. Span creation takes place in |
I think this issue can be closed as Java implements this according to the spec: The main recent addition is #7970 which removes the AWS X-Ray environment variable from the propagation chain and allows the regular propagators to be applied. Other languages may still require additional changes to implement the correct propagation. |
Closing. Thanks! |
…7970) open-telemetry/opentelemetry-specification#3166 Per discussion in the FAAS SIG, we decided that the AWS X-Ray environment variable should be moved to a span link to avoid interfering with the configured propagators. Also related to #5167.
Hello,
I am trying to make aws-sdk SQS context propagation work between applications written in Java (scala actually), and nodejs / ruby.
In order for it to work, both the sender and receiver should agree on how to inject and extract the context onto the messages.
Unfortunately, Java and node \ ruby behave differently which creates broken traces for end-users who are sending messages across those systems.
NodeJS \ Ruby
These implementations use the "OpenTelemetry" approach. They use the propagators registered in the otel API (w3c \ b3 \ custom \ etc) to inject and extract context from the message attributes
Cons
There are quotas on SQS messages which the context propagation consumes: (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) which means:
Java
The jave implementation is using the
X-Amzn-Trace-Id
header, which does not consume quotas like the Nodejs \ Ruby implementation, but has the following cons:Cons
W3C Baggage
propagator.Action Items
Considering the above Pros and Cons, I want to suggest adding a second propagation style into the aws-sdk instrumentations, which is compatible with nodejs / ruby and allow the user to bypass the x-ray propagator so the above compatibility issues will not affect his application.
I'll be very happy to get more insights and ideas on this issue. Do you think it makes sense adding this new propagation style? Maybe AWS has plans to solve the compatibility problems in the near future?
The text was updated successfully, but these errors were encountered: