-
-
Notifications
You must be signed in to change notification settings - Fork 327
Observability Support for SQS #1369
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
base: main
Are you sure you want to change the base?
Conversation
74e4674
to
e44502e
Compare
Awesome!!! Can't wait to take a look tomorrow 🥳🥳🥳🥳 |
I just installed a local build and tested it with my services where I removed my own extensions for trace propagations: after setting In my own code, which still uses Brave directly instead of the Micrometer APIs, I also ensured that baggage wouldn't be blindly propagated as there's a hard limit of 10 on the nr of MessageAttributes that you can have in one message: I haven't checked the code of this PR yet to to see if something similar is done (or needed) here, will try that as well. |
I just configured the following property:
I then sent an HTTP request to the service that triggers the sending of an SQS message in response, with headers X1 up to X9.
There is very limited space for message attributes in SQS (and application code might use some as well), so I believe that by default the framework should NOT respect the baggage remote-fields configuration: it should limit itself to the |
I also verified that this solution ensures that the trace context is still active when you implement an |
Thanks a lot for looking into this @jkuipers!
Good call, that makes sense to me. I think for the scope of this PR we can remove baggage remote-fields propagation in messages, then in a separate issue / PR we can discuss how to include them as opt-in. I wonder if @jonatan-ivanov has an opinion on this. Also, any suggestions on how to configure baggage propagation this way are welcome. Thanks! |
Hey @jkuipers, to your suggestion, I've limited the propagated attributes to If you can, please give it another go and let me know how that works for you. Thanks! |
Looks good! This is similar to what I'm currently doing in my own code. I am only wondering if anyone might still configure their Spring Boot 3.x app to use b3 headers rather than the W3C Trace Context |
@jkuipers good call, we should support B3 as it's supported by Micrometer - just pushed that change.
Agreed, we can always add opt-in support later if users request, but for default behavior the current approach seems sensible and should work well for the majority of users. Anything else you think is relevant? I'm aiming to merge this PR next week or so if there's nothing else. Super thanks again for looking into this! |
This covers everything that I thought of when building my own (simpler) trace support, so as far as I’m concerned this is ready to merge! |
Code looks good to me. @tomazfernandes when you want merge :) |
Thanks a lot @jkuipers and @MatejNedic! This was a tough one to pull off given the async nature of the integration, I'm happy with the result 🙌🏼 I'll keep the PR open for a few more days, and hopefully merge it at the end of the next week or so. Then there are a few Observability and ThreadLocal related issues I'll open after that - more to come! |
This PR Introduces Micrometer Observability Support for Spring Cloud AWS SQS.
Features
Batch sending and receiving of messages is not supported to avoid increasing this PR further.
Available Observations
Spring Cloud AWS SQS provides the following observations:
spring.aws.sqs.template
- Records SQS operations performed through theSqsTemplate
spring.aws.sqs.listener
- Records message processing through theSqsMessageListenerContainer
Both observations include the following common tags:
Low cardinality tags:
messaging.system
: "sqs"messaging.operation
: "publish" (template) or "receive" (listener)messaging.destination.name
ormessaging.source.name
: The queue namemessaging.destination.kind
ormessaging.source.kind
: "queue"High cardinality tags:
messaging.message.id
: The SQS message ID from AWS.For FIFO queues, the following additional high cardinality tags are included:
messaging.message.message-group.id
: The message group IDmessaging.message.message-deduplication.id
: The message deduplication IDResolves #1367