Skip to content
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

Add support for Micrometer's new Observation API #1734

Closed
jonatan-ivanov opened this issue Aug 27, 2022 · 7 comments
Closed

Add support for Micrometer's new Observation API #1734

jonatan-ivanov opened this issue Aug 27, 2022 · 7 comments
Labels
proposal Proposed Specification or API change

Comments

@jonatan-ivanov
Copy link

Micrometer introduces a new set of APIs in its next minor version (1.10.0).
From the high level perspective this API is somewhat similar to a Timer in the sense that it measures elapsed time and you can start/stop your measurements.

The advantage of making measurements using the Observation API over the Timer is that you can attach arbitrary handlers (listeners) who can react to events during your observations, e.g.: an observation was started/stopped and error happened, etc. This makes possible not only recording metrics (delegating to a Timer) but also creating Spans (distributed tracing), attaching logs (audit, trace, perf, etc.) or doing any arbitrary thing that you want.

Basically you instrument your code once and you can get multiple things out of this instrumentation, you don't need multiple instrumentations.

We have a migration guide that can give more information and also examples for migrating from a Timer-based instrumentation to the Observation API.

What do you think?

@OlgaMaciaszek
Copy link

@velo @kdavisk6 We are making some major changes when it comes to tracing and observability for Spring 6. In order to maintain functionality, we would like to propose the change described above. We could provide the contribution. Please let us know what you think.

@kdavisk6
Copy link
Member

Apologies, I think this is a very good idea. Feel free to submit any proposals.

@kdavisk6 kdavisk6 added the proposal Proposed Specification or API change label Sep 12, 2022
@OlgaMaciaszek
Copy link

Thanks :) . We'll do.

@marcingrzejszczak
Copy link
Contributor

I've submitted a draft PR that we can discuss - #1760

@Nicklas2751
Copy link
Contributor

The PR is merged so this can be closed, right?

@marcingrzejszczak
Copy link
Contributor

Yes!

@jonatan-ivanov
Copy link
Author

Fixed by #1760

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposed Specification or API change
Projects
None yet
Development

No branches or pull requests

5 participants