aws-sdk-java-v2 icon indicating copy to clipboard operation
aws-sdk-java-v2 copied to clipboard

Add support for Micrometer's Observation API

Open jonatan-ivanov opened this issue 2 years ago • 5 comments

Describe the feature

With Micrometer 1.10.0 (I'm a maintainer), a new API was released called the Observation API. It lets users instrument their components once and then get multiple benefits out of it e.g.: metrics, distributed tracing, (audit) logs, publishing arbitrary events, etc.

We also released Micrometer Tracing (it's a new project) which is not a must but plays nicely with the Observation API and it can bridge calls to OpenTelemetry or OpenZipkin's Brave.

What do you think about instrumenting the AWS SDK using Micrometer (probably in a separate module) so that users can get observability support when they use the SDK.

Use Case

The use cases are quite wide, the goal of the Observation API is to be able to cover a lot of the Observability needs of the users, for example:

  • Users want metrics in their apps (they can use micrometer metrics or other libraries, e.g.: dropwizard-metrics)
  • Users want distributed tracing in their apps (they can use Micrometer Tracing with Brave/OTel or other libraries)
  • Users want both metrics and distributed tracing in their apps
  • Users want to listen to and publish custom events in their applications and emit logs, write an audit DB, etc.

Proposed Solution

No response

Other Information

It seems that there is a user demand for this, see:

  • https://github.com/awspring/spring-cloud-aws/issues/646
  • https://github.com/awspring/spring-cloud-aws/issues/566
  • https://stackoverflow.com/questions/77227632/unable-to-trace-in-spring-boot-3-when-using-sqs-queue
  • https://stackoverflow.com/questions/74477506/how-to-track-request-metrics-in-aws-java-sdk-amazons3-client-in-micrometer
  • Quite a few users were asking about this (mostly SQS) on Micrometer Slack too

Acknowledgements

  • [X] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

AWS Java SDK version used

irrelevant

JDK version used

irrelevant

Operating System and version

irrelevant

jonatan-ivanov avatar Oct 18 '23 19:10 jonatan-ivanov

@jonatan-ivanov thank you for reaching out.

Yes, we are interested in adding support for observability tools in the SDK. The way we envision this is with some kind of interface or abstraction layer in the SDK clients where you can simply provide the tool you want to use, with no implementation of a separate SDK module needed.

It's something we have in our roadmap, but we don't have concrete design plans yet, and no, we don't have a timeline to share. Let's use this Github issue to keep track of the feature.

Note to the community: add a 👍 to the description if you are interested in this. Also feel free to comment about the features you'd like to have around observability in the Java SDK.

debora-ito avatar Oct 28 '23 01:10 debora-ito

Isn't ExecutionInterceptor such an interface?

What do you mean by this:

where you can simply provide the tool you want to use, with no implementation of a separate SDK module needed.

What do you mean by "tool"? A library that can be used to instrument the SDK, like Micrometer? By "separate SDK module", do you mean the AWS SDK?

jonatan-ivanov avatar Oct 31 '23 17:10 jonatan-ivanov

We are thinking more like first-class support for observability tools, not through ExecutionInterceptor but as a setting at the client level, via a pluggable interface. But again, we have no concrete designs yet, it's just the idea.

debora-ito avatar Oct 31 '23 22:10 debora-ito

Hello, have there been any updates on this issue? We are looking for better tracing instrumentation of SQS and this would be a useful fix towards that goal.

karkum avatar Dec 16 '24 18:12 karkum

Bumping this. The Spring Cloud AWS project now has a working implementation that should land soon.

  • https://github.com/awspring/spring-cloud-aws/pull/1369

raskasa avatar Apr 11 '25 00:04 raskasa